\I'm darn nearly pulling my hair out trying to figure this out tonight. I'm hoping someone can help me out.
I have 3 TLD's for a site, similar to the following:
- www.domain.com
- www.domain.org
- www.domain.net
They are all located in the same directory.
I would like to set up 301 redirects so that all pages of the .org and .net point to their respective pages at the .com location.
For example, domain.net/topic/page as well as www.domain.net/topic/page should permanently redirect to www.domain.com/topic/page.
Currently, I am using the code below which only redirects the .net and .org home pages to the .com home page.
RewriteCond %{HTTP_HOST} !^(www\.)?domain\.com$ [NC]
RewriteRule .?$ http://www.domain.com%{REQUEST_URI} [R=301,L]
Thank you for your time,
Casey