Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Sep 2010
    Posts
    69
    Thanks
    8
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    If you can use an htaccess file you could rename your files and then use mod_rewrite so .html names still work.
    OracleGuy

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,700
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    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)

  • #4
    New Coder
    Join Date
    Sep 2010
    Posts
    69
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Thanks, I haven't had luck so far but i'll keep working on it

  • #5
    New Coder
    Join Date
    Sep 2010
    Posts
    69
    Thanks
    8
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

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