Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-19-2010, 10:05 PM   PM User | #1
KatieK
New Coder

 
Join Date: Sep 2010
Posts: 67
Thanks: 8
Thanked 0 Times in 0 Posts
KatieK is an unknown quantity at this point
Using SSI without .shtml

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?
KatieK is offline   Reply With Quote
Old 10-19-2010, 11:12 PM   PM User | #2
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,043
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
If you can use an htaccess file you could rename your files and then use mod_rewrite so .html names still work.
__________________
OracleGuy
oracleguy is offline   Reply With Quote
Old 10-19-2010, 11:12 PM   PM User | #3
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,604
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
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/advanc...ess-file.shtml (specifically the line in the second box)
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 10-26-2010, 04:05 PM   PM User | #4
KatieK
New Coder

 
Join Date: Sep 2010
Posts: 67
Thanks: 8
Thanked 0 Times in 0 Posts
KatieK is an unknown quantity at this point
Thanks, I haven't had luck so far but i'll keep working on it
KatieK is offline   Reply With Quote
Old 11-02-2010, 05:46 PM   PM User | #5
KatieK
New Coder

 
Join Date: Sep 2010
Posts: 67
Thanks: 8
Thanked 0 Times in 0 Posts
KatieK is an unknown quantity at this point
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
KatieK is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:20 AM.


Advertisement
Log in to turn off these ads.