Website Technical Question: Displaying a banner across all pages in a folder?

Let’s say I have a website at www.example.com with a subdirectory, www.example.com/users/

Is there anything I can do on the server side to force all HTML pages in /users/ to display a banner and/or pop-up without modifying the HTML files themselves?

Is this something an .htaccess or similar can accomplish?

(The banner is meant to tell viewers that they’re viewing third-party content hosted on, but not managed or endorsed by, example.com)

ETA: The server is running Linux with Apache

I’m thinking of using .htaccess rewrites to redirect all HTML files to a PHP script, which will prepend the banner and then output the rest of the original HTML.

Is there a more elegant way?

Are you saying you can’t modify the html files in /users/ or that you can’t modify the html files in any of example.com?

If it’s the former, you could load up example.com/users.html (a new file) that contains the banner and an iframe, the src of the iframe being example.com/users/

As the user clicks through the pages in the /users/ app, the URL in the browser would stay as users.html, and the banner would remain at the top of the page, but the /users/ app would chug along from within the iframe.

The former. Can’t (more accurately, don’t want to) modify files in /users/.

But I don’t want the functionality to be limited to people who view users.html. I want anyone who visits example.com/users/john/index.html or example.com/users/bob/index2.html or any other HTML file to automatically and forcibly see the banner.

I’ve resorted to the .htaccess method I mentioned because I couldn’t think of any other way. It wasn’t as hard as I thought, but if anyone has a better way, I’m still all ears :slight_smile: