Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

How to reference a universal header Menu

I want a universal header displayed across the website

3:37 pm on Nov 24, 2008 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 11, 2005
votes: 0

Very simple request, and I thought I would easily find tutorials on it online, but didn't find much.

I have a new universal header for my website (header.php) and I want it displayed all across the website. How can I go about doing this? It is actually in HTML format, and I am not sure if I can keep it like that, or does it have to be saved in .php to be able to display it across the website?

Right now, I am using Front Page's 'Page display' feature, which is not very effective, and I want a better faster way to do this. So that when I change something in the header file, it will be displayed all across the website immediately.

Thanks a lot

4:24 pm on Nov 24, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:Feb 22, 2008
votes: 0

You can set 'auto-prepend-file' ini setting, can be set in php.ini, .htaccess or httpd.conf


6:22 pm on Nov 24, 2008 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 11, 2005
votes: 0

Can I just reference a header.php using a php command in an .html page?


4:46 am on Nov 25, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 24, 2005
votes: 0

If you can tell apache to parse .html files as php you can easily include your header.php on top of all those html files.
You can tell apache to parse .thml as php either via httpd.conf or simply by adding this line to .htaccess file in your directory

AddType application/x-httpd-php .html

Once either of them is done , you simply go to lets say

and add

include "header.php";

on top.

And hey, if you go the httpd.conf route then you will have to restart apache before checking if it works

[edited by: Anyango at 4:47 am (utc) on Nov. 25, 2008]


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members