How can I make pages load regardless if .htm or .html is called?
I have page new.htm, I want that to come up whether someone types in new.htm or new.html
Can that be set in cpanel?
How can I make pages load regardless if .htm or .html is called?
I have page new.htm, I want that to come up whether someone types in new.htm or new.html
Can that be set in cpanel?
Assume you have tested and it's not working?
It should work by default as .htm/.html fuctionality is normally included in the DirectoryIndex statement in httpd.conf.
That is not what the op means. He means if somebody calls for www.domain.com/new.html but new.html does not exist and new.htm does exist, is there a way to get he webserver to display the contents of new.htm automatically when there is a 404 error on new.html.Originally Posted by sawbuck
Marty Hoskins
TLC Web Enterprises
The best long term option would be to design all URLs to not be specific to the format of the document.
For example, instead of having http://www.example.com/new.html, have http://www.example.com/new/index.html, which to the user would only need to be http://www.example.com/new/, therefore helping to both reduce the chance of the user mis-typing a URL and increase the chance of the user remembering the URL.
Furthermore, URLs of the form http://www.example.com/new/index.html could then be changed, if needed, to http://www.example.com/new/index.php without needing to change any links - more forwards compatible.
However such a suggestion is not a solution to the specific problem at hand, nevertheless it helps minimise the risk of such problems occurring and so I thought it worth mentioning.
a simple .htaccess file will do the trick
Options +FollowSymlinks
rewriteengine on
rewriterule ^(.*)\.htm$ http://yourdomain.com/$1.html [r=301,nc]
the above asumes that you have all html files and want all htm to go to there corisponding html files reverse the code if you want it to go the other way
warning with the above example if you have working htm files it will redirect them to html if they do not exist 404![]()
Lowest Host/Empire Technology LLC
Affordable hosting solutions http://empire-hosting.net
List Your hosting site FREE in http://hostgeneration.com