htaccess question

BuzzKill

Regular Member
Joined
Aug 30, 2007
Messages
431
Reaction score
222
what do i need to put in my htaccess file to make any of the .htm pages direct to and .html page, might not make sense but it has to do with a shitload of .htm pages being indexed that dont exist anymore.
 
Hi BuzzKill,

Try the below code:

Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm $1.html [nc]

But if you want the search engines to reflect new pages as being indexed as .html files, then you will need to do something different. You will have to actually Perm. redirect them. Try this code below:

Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.+)\.htm http://YOURDOMAIN.COM/$1.html [r=301,nc]

Replace YOURDOMAIN.COM with your domain name.

NOTE: If you get a 500 internal error or something after putting in the code, try taking out Options +FollowSymlinks and see if it works. It may already be enabled on your server but disallowed in .htaccess.


Let us know if that works.

Chris
 
you can try online generator ex: http://www.southeasttelephone.com/tools/htAccessor/htaccessor.php
 
Back
Top