Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Regarding URL Redirect

11:41 pm on Jul 20, 2009 (gmt 0)

5+ Year Member


I would like to redirect my url's through .htaccess. Its Apache/1.3.41 (Unix) type server.



I would like to know the code to redirect.


Actually I used
"RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.example.com.com$
RewriteRule ^index.htm$ "http\:\/\/www\.example.com\.com" [R=301,L]

RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule ^/?$ "http\:\/\/www\.example.com\.com" [R=301,L]"
But it doesn't work and now If i type example.com, I was taken to parking page


Please let me know about this. I looking forward for your reply. If you have any questions. Please let me know. Thanks.

5:02 am on Jul 21, 2009 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

These subjects are already very-well covered here, but here's the code:

# Redirect to canonical home page on canonical domain
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /index\.htm\ HTTP/
RewriteRule ^index\.htm$ http://www.example.com/ [R=301,L]
# Redirect to canonical domain
RewriteCond %{HTTP_HOST} !^(www\.example.com)?$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]