|
|
|
|
|
|
|
![]() |
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
![]() |
#1 |
WHO IS FONZY!?! Don't they teach you anything at school?
Join Date: May 2004
Location: Norway
Posts: 48
|
How to add header and footer with .htaccess
Help, i need to use .htaccess to inser headers and footers.
Anyone here that know the code to insert? Stein |
![]() |
![]() |
![]() |
#2 |
Subversive filth of the hedonistic decadent West
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
|
I use php or ssi to add headers and footers not htaccess.
|
![]() |
![]() |
![]() |
#3 |
Vagabond
|
The Apache module is called mod_layout.
|
![]() |
![]() |
![]() |
#4 |
Subversive filth of the hedonistic decadent West
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
|
That is what I love about this business, always something new to learn.
![]() |
![]() |
![]() |
![]() |
#5 |
WHO IS FONZY!?! Don't they teach you anything at school?
Join Date: May 2004
Location: Norway
Posts: 48
|
Hmm i dont know shit about php and ssi.
tried an acces file with Header Add Name header.html Footer Add Name footer.html And got an 500 error. I still have much to learn Stein |
![]() |
![]() |
![]() |
#6 |
Certified Nice Person
|
PHP seems the simplest way. Construct your html pages as you normally would but name each one whatever.php instead of whatever.html. On each php page, you'll place an include tag on top for your header like this:
<?php include("header.html"); ?> At the bottom, where you want your footer to be, you'll place this: <?php include("footer.html"); ?> Obviously, you'll need to build your header.html and footer.html pages. So, whatever.php could look something like this: <?php include("header.html"); ?> <table><tr><td>All the wacky porn shit you want on your page. </td></td></table> <?php include("footer.html"); ?> Play with this a bit and you will get hooked on it. You'll find yourself building pages that are almost all include tags, pulling in info from other php and html source pages. As long as you use the .php extension you can use the php include tags. Otherwise, it can all be html code. Keep in mind, you have to test these php pages online, unless you have PHP on your home system.
__________________
Click here to purchase a bridge I'm selling. |
![]() |
![]() |
![]() |
#7 |
WHO IS FONZY!?! Don't they teach you anything at school?
Join Date: May 2004
Location: Norway
Posts: 48
|
Thanks for the useful info Useless Warrior
i will try out that one. Stein |
![]() |
![]() |
![]() |
#8 |
A woman is like beer. They look good, they smell good, and you'd step over your own mother just to get one!
|
while useless warrior's way is certainly easy, mod_layout is the easiest of all ways to go because you don't have to alter your page code at all.
http://tangent.org/index.pl?lastnode_id=478&node_id=362 just have your admin add the module to your apache, it's generally not there by default. -jason |
![]() |
![]() |
![]() |
#9 |
Programming till my fingers bleed.
Join Date: Aug 2003
Location: Michigan
Posts: 876
|
There are many ways to do it.
If you are using php (ie., php extensions or html is configured to be parse by php) you could use the following in an htaccess. php_value auto_prepend_file "/path/to/header.php"; php_value auto_append_file "/path/to/footer.php"; That will put those files at the top and bottom of each php file or any file configured to be parsed by php. If you are looking for other ways, SSI might be an option for you otherwise you would need some scripting experience or one of the apache modules these other fine folks talked about. Andy |
![]() |
![]() |
![]() |
|
|