Ive been using the following code..
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.domainname\.com [NC]
RewriteRule ^(.*) http://www.domainname.com/$1 [L,R=301]
which redirects the domain from http://domainname.com to http://www.domainname.com to help in the search engines.. but anyway the problem is I've just registered another domain with a ' -' in it.. like domain-name.com and i've tried using the same code..
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.domain-name\.com [NC]
RewriteRule ^(.*) http://www.domain-name.com/$1 [L,R=301]
But it doesn't work.. so I quess it must be because of the ' -'
So do I need to add something extra or make a change?
Thanks!
|