PDA

View Full Version : Using SSI without .shtml



KatieK
Oct 19th, 2010, 11:05 PM
We're redoing some of our old websites so that they have include files but the includes only work if the extension is .shtml. Normally this would be fine, but since the websites have been published for years, redoing the extension messes up our search results, the old pages show up and don't link anywhere and the new pages don't show up at all yet.

So I'm wondering is there a way to use includes without having to change the extension?

oracleguy
Oct 20th, 2010, 12:12 AM
If you can use an htaccess file you could rename your files and then use mod_rewrite so .html names still work.

VIPStephan
Oct 20th, 2010, 12:12 AM
There are two ways, both of them require changing settings in the server configuration or an htaccess file:

#1: You do use the shtml extension but use a 301 (premanent) redirect through htaccess. Look up a search engine of your choice to learn what and how to do this.

#2: You set up a rule (again, in an htaccess file – or by changing the server config if you’re able to) to treat files with the html extension as SHTML files. Look up “enabling SSI” on this page: http://www.buildwebsite4u.com/advanced/htaccess-file.shtml (specifically the line in the second box)

KatieK
Oct 26th, 2010, 05:05 PM
Thanks, I haven't had luck so far but i'll keep working on it

KatieK
Nov 2nd, 2010, 06:46 PM
got it to work, this is the code i ended up using, just added it to the htaccess file

AddType text/x-server-parsed-html .shtml .htm .html