#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2008
    Posts
    670
    Rep Power
    38

    Is there a way to configure a server to render HTML files without the html extension?


    Is there a way to configure a server to render HTML files without the html extension? I can do it with deep linking, but this file will not be pulled into any pages, needs to exist on it's own, and client doesn't want to have ".html" at the end of the file name.

    thanks
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Location
    Haifa, Israel
    Posts
    17
    Rep Power
    0
    Hi lelales,

    (These instructions are good only for a Linux PHP Apache-based server.)
    1. Check if you already have a .htaccess file that's in the root directory of your server. If you do not have one yet, you can easily establish this file. Here's one resource:
    http://www.youtube.com/watch?v=SupSIcwxptU
    2. Once you have created the file or opened the existing one, open the file using FTP software and insert this rule:
    Options +MultiViews
    [This makes the server look for the closest match of a referenced page. If you referenced a page "index.html", and the closest one the server finds is "index" (without the .html extension), it will render index.]
    There are some host servers that have this rule in place by default, but not all.
    3. Save the file and reload it to the web server.
    4. Now, if you access "index" without the ".html", you will have no problem.
    One tip for consistency is to serve all your files using the same format, so don't have some files ending in .html and others not.

    HTH

IMN logo majestic logo threadwatch logo seochat tools logo