|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
What on Earth have I done? [301 redirects - .htaccess]
I have been tinkering around with 301 redirects through .htaccess, and now I don't know what I've gotten myself into.
I initially wanted to redirect WWW to non-WWW URLs, or vice versa to avoid duplicate indexing. (Like http://www.website.com to http://website.com) Below is the code I have had on my server for a month. It is doing SOMETHING - this I know, but I don't know what I've done exactly. Can someone decipher my .htaccess script below and tell me what exactly this is redirecting to where? The Code: Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^locksmith-buckhead.com [NC] RewriteRule ^(.*)$ http://www.locksmith-buckhead.com/$1 [L,R=301] Any help would be appreciated. Thanks, Snake |
|
#2
|
|||
|
|||
|
If you haven't fixed it yet then you might want to try this code:
Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^locksmith-buckhead.com$ [NC] RewriteRule ^(.*)$ http://www.locksmith-buckhead.com/$1 [R=301,L] If that doesn't work then you may want to contact your web host and ask them what the proper code is. I don't know alot but I do know that it has something to do with the way your server handles 301's, in either case try the code above, hopefully this will work. One other thing to keep in mind is that it can sometimes take awhile for the redirect to kick in, but again this will depend on your web host. |
|
#3
|
|||
|
|||
|
Thanks for the help, it turned out that the server just took a while to recognize it!
Quote:
|
|
#4
|
|||
|
|||
|
Use rel="canonical"
You can also use the <link rel="canonical"> tag to let spiders know which domain you prefer. Google treats these similar to a 301, but doesn't actually redirect the visitor.
|
![]() |
| Viewing: SEO Chat Forums > Google > Google Optimization > What on Earth have I done? [301 redirects - .htaccess] |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|