November 27th, 2013, 09:47 AM
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.
December 29th, 2013, 08:27 AM
(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:
2. Once you have created the file or opened the existing one, open the file using FTP software and insert this rule:
[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.