Nov 22

To redirect a URL such as http://yourdomain.com/ to http://www.yourdomain.com/ use:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain\.com
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=permanent,L]

In the RewriteRule code, the R=permanent sets the type of redirection (permanent is 301; the default is temporary or 302). The L makes this the last Rule to use and stops rewrite processing.

written by MG \\ tags: , ,


Leave a Reply

*