Click to See Complete Forum and Search --> : Html include file
RyanUK
08-17-2006, 03:20 PM
Hello,
Is it possible to use a include with a .html file? I'm wanting to have the main index file with an include for the navigation menu in a folder called includes. I know with php theres the <?php include ("include/navbar.php") ; ?> but is there anything for html? The reason I ask is because my website is going to have a lot of webpages and I want to make the navigation menu easy to update and modify.
Thanks,
Ryan
toicontien
08-17-2006, 03:42 PM
That's about as easy as it gets, really. There's a method called Server Side Includes that uses just about the same amount of code. Even if you used a PHP include, you don't need to use PHP in the included file. It can all be HTML.
<!-- #include file="something.html" -->
Every web page that uses this must have a .shtm or .shtml file extension and Server Side Includes must be enabled on the Web server.
David Harrison
08-17-2006, 03:47 PM
You could use frames, but I advise against it, frames are never a good way to go for a number of reasons, but I won't go into it here.
You could use a server-side language, such as PHP as you said, but it sounds as though your server doesn't have PHP support.
You could also use server-side includes (SSI), however if your host doesn't support a server-side language they may not support SSIs either.
If you're using a free host then to be able to use nifty server-side features you'll have to find a paid host, but if you're already using a paid host they'll almost certainly have some server-side language you can use.
RyanUK
08-17-2006, 03:47 PM
Thank you for your quick response. Are .shtm pages crawled as effectly as .html ones?
(I do have php enabled on my server (I have a reseller control center too) but I've heard .php pages arn't crawled very well in the search engines)
Thanks again,
Ryan
David Harrison
08-17-2006, 03:53 PM
Google doesn't care about the file extension, .php, .html, .shtml, it's all the same. Google only cares about content.
You can even remove the .php at the end of the filenames if you want with a .htaccess file (so long as your host runs Apache as it's web server).
RyanUK
08-17-2006, 03:58 PM
what code would be needed in the .htaccess file to remove the .php end of the filename? Yes my host runs Apache.
Thanks
David Harrison
08-17-2006, 10:32 PM
Google is your friend, a quick search turned this (http://spindrop.us/2006/07/26/how-to-remove-file-extensions-from-urls/) up, among others (http://www.google.co.uk/search?client=firefox-a&rls=org.mozilla%3Aen-GB%3Aofficial_s&hl=en&q=.htaccess+remove+.php+extension&meta=&btnG=Google+Search).