I own www.allmusiclibrary.com and the related .org and .net extensions. I want to redirect the .org and .net extensions so that they are re-written/redirected to the .com extension. I believe that the mod_rewrite isn't the right way to do this. Right now .org/.net will display the same website as the .com, except with the corresponding extension in the address bar... so... What's the best SEO way to rewrite the .org and .net extensions to .com?
Alright, seems to work nicely. I dropped these lines in my .htaccess file. Is this coding a little redundant, it seems like there'd be a cleaner way... RewriteEngine on rewritecond %{http_host} ^allmusiclibrary.net [nc] rewriterule ^(.*)$ http://www.allmusiclibrary.com/$1 [r=301,nc] rewritecond %{http_host} ^allmusiclibrary.org [nc] rewriterule ^(.*)$ http://www.allmusiclibrary.com/$1 [r=301,nc] rewritecond %{http_host} ^www.allmusiclibrary.net [nc] rewriterule ^(.*)$ http://www.allmusiclibrary.com/$1 [r=301,nc] rewritecond %{http_host} ^www.allmusiclibrary.org [nc] rewriterule ^(.*)$ http://www.allmusiclibrary.com/$1 [r=301,nc] rewritecond %{http_host} ^allmusiclibrary.com [nc] rewriterule ^(.*)$ http://www.allmusiclibrary.com/$1 [r=301,nc] Code (markup):
Dooh! Just double check each of the ones you want to redirect. On the condition line you might need a $ at the end of the URL. Like so: RewriteCond %{HTTP_HOST} ^example.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] Code (markup):
I agree about the $ sign. Also you can shorten what you did by using the [OR] as in the following: This essentially says that either of the first two sites gets redirected to the last site in the list.
What's the purpose of the $? is it the first variable withwhich $1 is pulling a value? Without it it seems to be rewriting the variables correctly, nevertheless. oh and oddcomments, what's your "Search Engine for Search Engine Optimizers"? I don't get it.