View Full Version : How to reach webpage without type .HTML

Apr 6th, 2010, 11:52 AM
I have http://example.com/archive/page.html

But some visitors reach my website via http://example.com/archive/page (without .html extension) and it's always go to ads page of my hosting so I want .htaccess code that automatically go to http://example.com/archive/page.html

There are many pages in "archive" dir, and I do not want to use this rule in the root and all other directories.

How can I do this my .htacess?
and what directory should I put htaccess file into?

Thank You,

Apr 6th, 2010, 01:00 PM
There are many results if you perform a search with the right keywords: http://www.google.com/search?q=htaccess+url+rewrite
Specifically corz.org (http://corz.org/serv/tricks/htaccess2.php) looks like a useful website which explains everything.

The htaccess file would go into the root if you want to apply the rules to your entire site or in the directory where you want to apply them (note that RewriteBase should be set accordingly).