www.webdeveloper.com
Results 1 to 5 of 5

Thread: Separate files for header and footer

  1. #1
    Join Date
    Jan 2007
    Posts
    16

    Arrow Separate files for header and footer

    Hi all,
    all of my site's pages have the same headers and footers, so I want to use two separate files - one for the header and one for the footer.
    I think it can be done using :
    Code:
    <!--#include virtual="footer.html"-->
    and by renaming all the pages to the .shtml suffix.

    What else should I do, because right now it's not working.

    Plz Help !

  2. #2
    Join Date
    Apr 2006
    Posts
    225
    Did you remove the <html>, <head>. <body> and Doctype from the html file? You only need the actual html code on the footer.html page.
    Did you insert <!--#include virtual="footer.html"--> in the location it would normally be in the .shtml page code?

  3. #3
    Join Date
    Jan 2007
    Posts
    16
    Thanks for the reply.
    I did all that. But I think you have to do something with a ".access" file, right ?

  4. #4
    Join Date
    Apr 2006
    Posts
    225
    Configure you path as <!--#include virtual="/footer.html"--> or maybe <!--#include virtual="../footer.html"-->. This is assuming your file is in the root directory and not a folder. Also see http://www.entheosweb.com/website_de...e_includes.asp

  5. #5
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    Check with your site host. You might need an .htaccess file to set this up or you might be able to do it through a control panel or you might not be able to do it at all through that mechanism.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles