View Full Version : help on .shtml extension
czarina
06-05-2008, 04:09 PM
Hi all-
I want to add a shtml to my header, footer and navbar and not sure how to use it with bluehost.
Can anybody here help or give me a suggestion on how to do this?
I also went to the CGI section of blue host and found this:
Editing the Random HTML Template
Is this the same thing as the .shtml extension's function? If so, can anyone recommend a step by step tutorial on achieving this?
Thanks all for your help! I look forward to your replies.
Czarina
actuallyromantic.com
Early Out
06-05-2008, 04:13 PM
Server-side includes work just fine on BH. Remember, however, that the file that calls those includes is the one that has to have the .shtml extension. The called files can be anything you like.
This thread (http://www.bluehostforum.com/showthread.php?t=13164) might be helpful (if you can wade through some of the extraneous stuff, and the one hidden trap that took us a while to figure out!).
czarina
06-05-2008, 04:38 PM
Thanks for the link.
Let me see if I understood it.
So, I have my header. I want the codes there in a separate file called header.shtml under my www folder (where all the other pages of my sites are at)
Then on all of the other pages where I want this file embeded, I just put:
<html>
<head>
<title>Include Test</title>
</head>
<body>
this is where i want the header so i put this code:
<!--#include virtual="/header.shtml" -->
this is where the footer goes so i put this code:
<!--#include virtual="/footer.shtml" -->
</body>
</html>
Did I understand that thread correctly? I haven't tried doing it. I just want to get confirmation first since you got your "test include" working
Also, do I need to set up my "Random HTML Generator" to get this working properly?
Thanks for your help!
Czarina
http://www.actuallyromantic.com
czarina
06-05-2008, 04:43 PM
Oh I forgot.
the header.shtml file will have the codes from my header. same with the footer.shtml.
Thanks,
Czarina
Early Out
06-05-2008, 04:43 PM
You're getting it backwards. The calling page has to have the .shtml extension, not the page that's being called.
I have no idea what the Random HTML Generator is - I certainly didn't have to use it to set up the little test site I put up (now gone, alas).
czarina
06-05-2008, 04:54 PM
LoL! ok thanks! let me try. i hope it works! (*crossing fingers*)
Czarina
czarina
06-05-2008, 05:11 PM
so does that mean i have to change all my webpages to .shtml extension?
Early Out
06-05-2008, 05:17 PM
If you want to use server-side includes, I believe the answer is "yes."
czarina
06-05-2008, 05:21 PM
hmmm. does that affect anything? i mean seach engine optimization or anything else?
do you know of other way of doing includes without changing all my pages to an .shtml extension.
they do it the other way around at sitesell. i have another website hosted by them and what i posted earlier is how they do it and it works fine. i wonder why?
Early Out
06-05-2008, 05:24 PM
You might want to spend a little time poking through this writeup:
http://httpd.apache.org/docs/1.3/howto/ssi.html
There are various ways of getting from A to B, and each has its upsides and downsides.
czarina
06-05-2008, 05:36 PM
Thanks, BH gave me this link too earlier. Let me try it this way (if I can) :)
Thanks again for your help!!
Czarina
Eriksrocks
06-05-2008, 06:41 PM
hmmm. does that affect anything? i mean seach engine optimization or anything else?
No, it shouldn't affect anything other than that your page extensions will all be .shtml.
do you know of other way of doing includes without changing all my pages to an .shtml extension.
You can do it just as easily with PHP using something like this:
<?php
require("yourfilename.html");
?>
Of course, then the extension would need to be .php instead of .shtml. :)
If you didn't want to change the page extensions you could add this to your .htaccess file:
AddHandler application/x-httpd-php .html
That will parse PHP in pages that have a .html extension. :)
felgall
06-05-2008, 06:47 PM
There are also entries you can add to your .htaccess file that will allow .htm or .html files to be parsed for SSI or PHP if you don't want to rename all the files.
Early Out
06-05-2008, 07:42 PM
There are also entries you can add to your .htaccess file that will allow .htm or .html files to be parsed for SSI or PHP if you don't want to rename all the files.
But, as the linked tutorial points out, this will slow down your site if most of your pages do not, in fact, have any server-side includes.
czarina
06-05-2008, 11:26 PM
I read that too in the article at apache.com
can anyone here explain the other option better. maybe that'll work the best. its the XBitHack directive.
do you know of any step by step tutorials on making this work?
thanks again for the replies!!
czarina
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.