I am a complete mod_rewrite new bie and despite review lots of answers, feel nervous about trying to adapt some answers that seem close to what i need, so let me ask this fresh:
For the domain hinduismtoday.com we have set the A name www.hinduismtoday.com
to the IP. then we have several CName alias which resolve to the same IP but are entered in the DNS as "www.hinduism-today.com
is an alias for www.hinduismtoday.com
On some other domain's our DNS admin has not been consistent and he set other domain names up as A names to the same IP . we can convert those to Cnames if that helps us here...
what I want to do is have mod_rewrite take all alias url's and A name url pointing to the same IP and re-write them to one common, base A name. the goal here is simple: prevent search engines from indexing pages at a diversity of URL, when in fact they are all the same page on the same web site.
simply stated: if someone enters (or Google follow a link on a third party site to:) www.hinduism-today.com/
or any www.hinduism-today.com/*foofileOrDirectory/
, we want Apache to return n: http://www.hinduismtoday.com//*foofileOrDirectory/
for all instances. This will let us set up site specific searching, which doesn't work now because Google's indexing of our sites is fragmented across a diversity of URL's. so, a site specific search will not pick up pages indexed until a CNAME url.
I know this has been asked and answered, but if someone could give me the mod_rewrite code for a .htaccess file test with a line by line brief explanation of what each line does, I will be most grateful! Also, let me know if having multiple Aname entries inthe DNS for the same IP will be handled the same by mod_rewrite, or if we should change all those to CNAMEs for the primary A NAME.