permanent 301 redirect on domain - am I doing it right?
Posted: Sat Mar 20, 2010 6:04 pm
Hey guys,
I've been looking for some information in regards to a permanent 301 redirect from a http://yourwebsite.com/ to http://www.yourwebsite.com/.
Most of the topics deal with re-directs of pages within certain domains or pages from one domain to another. I don't know much about PHP, but I do know this:
1) I need an .htaccess file in the root of my site.
2) The script should look something like this:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourwebsite.com.
RewriteRule ^(.*)$ http://www.yourwebsite.com/$1 [R=permanent,L]
Is this correct? It doesn't seem to be working. Every time I check in Google's websmaster tools, it doesn't show the 301 redirect. Am I doing this right? Or what am I missing in the .htacess file?
Any help is appreciated,
K
I've been looking for some information in regards to a permanent 301 redirect from a http://yourwebsite.com/ to http://www.yourwebsite.com/.
Most of the topics deal with re-directs of pages within certain domains or pages from one domain to another. I don't know much about PHP, but I do know this:
1) I need an .htaccess file in the root of my site.
2) The script should look something like this:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourwebsite.com.
RewriteRule ^(.*)$ http://www.yourwebsite.com/$1 [R=permanent,L]
Is this correct? It doesn't seem to be working. Every time I check in Google's websmaster tools, it doesn't show the 301 redirect. Am I doing this right? Or what am I missing in the .htacess file?
Any help is appreciated,
K