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

**URL:** <https://boards.straightdope.com/t/website-technical-question-displaying-a-banner-across-all-pages-in-a-folder/555189>\
**Category:** Factual Questions\
**Created:** [September 27, 2010, 5:59am UTC](https://boards.straightdope.com/t/website-technical-question-displaying-a-banner-across-all-pages-in-a-folder/555189 "2010-09-27T05:59:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reply](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/reply/32/15952_2.png) [@Reply](https://boards.straightdope.com/u/Reply)\
**Post date:** [September 27, 2010, 5:59am UTC](https://boards.straightdope.com/t/website-technical-question-displaying-a-banner-across-all-pages-in-a-folder/555189/1 "2010-09-27T05:59:09Z")

</div>

Let’s say I have a website at [www.example.com](http://www.example.com) with a subdirectory, [www.example.com/users/](http://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](http://example.com))

ETA: The server is running Linux with Apache

---

<div class="post-metadata">

**Author:** ![Reply](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/reply/32/15952_2.png) [@Reply](https://boards.straightdope.com/u/Reply)\
**Post date:** [September 27, 2010, 6:08am UTC](https://boards.straightdope.com/t/website-technical-question-displaying-a-banner-across-all-pages-in-a-folder/555189/2 "2010-09-27T06:08:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ZipperJJ](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/zipperjj/32/211_2.png) [@ZipperJJ](https://boards.straightdope.com/u/ZipperJJ)\
**Post date:** [September 27, 2010, 7:54am UTC](https://boards.straightdope.com/t/website-technical-question-displaying-a-banner-across-all-pages-in-a-folder/555189/3 "2010-09-27T07:54:35Z")

</div>

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](http://example.com)?

If it’s the former, you could load up [example.com/users.html](http://example.com/users.html) (a new file) that contains the banner and an iframe, the src of the iframe being [example.com/users/](http://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.

---

<div class="post-metadata">

**Author:** ![Reply](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/reply/32/15952_2.png) [@Reply](https://boards.straightdope.com/u/Reply)\
**Post date:** [September 27, 2010, 8:19am UTC](https://boards.straightdope.com/t/website-technical-question-displaying-a-banner-across-all-pages-in-a-folder/555189/4 "2010-09-27T08:19:47Z")

</div>

> [@ZipperJJ](#):
>
> 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](http://example.com)?
> 
> If it’s the former, you could load up [example.com/users.html](http://example.com/users.html) (a new file) that contains the banner and an iframe, the src of the iframe being [example.com/users/](http://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](http://example.com/users/john/index.html) or [example.com/users/bob/index2.html](http://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 🙂
