homepage Welcome to WebmasterWorld Guest from 54.226.136.179
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Content Management
Forum Library, Charter, Moderators: ergophobe

Content Management Forum

    
Redirect URL from Virtual root subdomain to addon domain
vividvilla



 
Msg#: 4402158 posted 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]

 

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4402158 posted 3:29 pm on Dec 29, 2011 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Content Management
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved