homepage Welcome to WebmasterWorld Guest from
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

desire www required and no direct subdomain.domain access
rewrite using HTTP_HOST or %{REQUEST_URI}

10+ Year Member

Msg#: 3255243 posted 6:16 am on Feb 17, 2007 (gmt 0)

I got myself confused.

I have several domains under one hosting package.

Example is mainsite.com (which the hosting pkg was originally
set up for), but now I also have subdomains of
subsite1.com subsite2.com and subsite3.com

subsite1.com is at mainsite.com/subdir1
subsite2.com is at mainsite.com/subdir2
subsite3.com is at mainsite.com/subdir3

Apparently the subsites can be accessed via subdir.mainsite.com

1) I would like to prevent access via subdir.mainsite.com


2) I would also prefer to see uniformity of any linking urls to
my sites (most use www) thus if!^www\. then rewrite the
mainsite.com to www.mainsite.com
likewise for the subsites....
subsite2.com to www.subsite2.com

Is there any easy way of doing this so that if I later
add any other subsites that I won't have to mess around much
with the coding? Not sure if the host "requires" access via
the subdir.mainsite.com stucture. It's shared hosting and
we are allowed up to 10 subdomains per main hosting account.

Don't want the search engines to consider the domains as being
any dupe content or have problems with the domains being under
the single hosting package. (I do keep away from having dupe
content). They are independent domains/sites.

Hope this isn't confusing to anyone. I have seen some similar
rewriting done using HTTP_HOST and by using %{REQUEST_URI}
and I don't know which would be better to be used or if both
are needed. Any scripts that I might use can be independent
within their own subdirectory, eg subdir1/cgi-bin/

Thanks. George.



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

Msg#: 3255243 posted 3:36 pm on Feb 19, 2007 (gmt 0)

If you can post the code you've tested, that would be a big help. Please see our forum charter [webmasterworld.com] for clarification.


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