Welcome to WebmasterWorld Guest from 54.235.25.206

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)

New User

joined:Dec 28, 2011
posts: 2
votes: 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)

Senior Member

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

joined:July 3, 2002
posts:18903
votes: 0


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.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members