Creating a modal warning for an external link? I'm attempting to return a pop-up warning for users who click an external link on my site. The issue is, the functionality must still be there if JS is disabled. I think this would leave PHP as my only option, so would this be accomplished with a custom plugin? I've seen sites accomplish something similar with a separate redirect php include with the link destination in a query string. My experience developing Craft plugins is virtually nil so forgive my ignorance- but would that look like a plugin that finds and rewrites all the external links' hrefs on the existing page, returns the html for the modal (appends a fullscreen div to the dom), and populates a "continue to external link" anchor based on the original link in the query string? Am I on the right track here?

Thank you!
A modal cannot exist without JS... no matter how it is triggered.

At best, you'd have the user navigate to an intermediate page, with "Forward" and "Back" buttons. That being said, the UX sounds pretty terrible in that case.

You're actually dealing with conflicting requirements:


Must warn people before leaving site.
Must be non-JS compatible.


Those two requirements will never really be in harmony.