homepage Welcome to WebmasterWorld Guest from 54.204.79.235
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 / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Alias: Page on Subdomain --> TLD homepage?
chopin2256




msg:3872857
 1:19 am on Mar 18, 2009 (gmt 0)

I am wondering if it is possible to alias a subdomain page to a top level domain homepage using mod rewrite. This is what I would like to do:

Have the contents of wiki.example.com/Page_To_Alias look like it would be on the top level domain, www.example.com

 

jdMorgan




msg:3873167
 12:06 pm on Mar 18, 2009 (gmt 0)

Yes, it's possible, but it creates a duplicate-content issue. More info on duplicate-content and the problems it causes fills our Google forum...

RewriteCond can be used to check the requested subdomain in the HTTP_HOST variable, and execute the rule based on that being "wiki". I don't advise it.

Jim

g1smd




msg:3873706
 8:56 pm on Mar 18, 2009 (gmt 0)

You could, however, advertise that short link to users and set up a 301 redirect so that when people request that URL they are redirected to the real location of the content. With a 301 redirect, there would not be a Duplicate Content issue.

chopin2256




msg:3873742
 9:35 pm on Mar 18, 2009 (gmt 0)

Would it just be easier to put the index.php file on the top level domain, (put it in www.example.com/copyofwiki/ and point the index.php paths to the subdomain wiki files? Then since I only want "one" page...the root page from the wiki basically, I can 301 the whole folder to the top level domain.

I suppose that would be a good strategy?

g1smd




msg:3873746
 9:41 pm on Mar 18, 2009 (gmt 0)

You don't want to 301 links that people click on on the pages of your site.

I don't understand what you mean by "301 the whole folder to the top level domain". You need to think about both "URLs the user sees" out on the web, and "internal paths to real files" inside the server.

They are two different things that are only 'associated' but NOT equivalent.

If you change URLs you need to redirect old URLs to new URLs.

You also need to rewrite URL requests to internal server file paths, adjusting to suit.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
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