Welcome to WebmasterWorld Guest from 54.157.222.62

Forum Moderators: ergophobe

Message Too Old, No Replies

Redirect URL from Virtual root subdomain to addon domain

   
2:39 pm on Dec 29, 2011 (gmt 0)



hello there

I have a example-root.com as my virtualroot so my addon domains are created inside the public_html directory.

I have addon domain called www.example-addon.com which is in public_html/example-addon directory.

Now my problem is it became two different version of the same site. So my entire site is became as duplicate contents and many URL from example-root.com/example-addon also indexed in search engine.

Both the website uses Drupal7 CMS.

Does anyone know how to redirect the later one to earlier one that is example-root/example-addon to example-addon.com

[edited by: ergophobe at 8:57 pm (utc) on Jan 4, 2012]
[edit reason] URLs exemplified; formatting for readability [/edit]

3:29 pm on Dec 29, 2011 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



One or two lines of RewriteRule code will do the job.

It's almost the same code you use to redirect non-www to www. Just test for NOT www.example.com to redirect all non-canonical variants.


Use example.com in this forum to suppress the auto-linking function.