Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

desire www required and no direct subdomain.domain access

rewrite using HTTP_HOST or %{REQUEST_URI}

6:16 am on Feb 17, 2007 (gmt 0)

New User

10+ Year Member

joined:Apr 28, 2003
votes: 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.

3:36 pm on Feb 19, 2007 (gmt 0)

Senior Member

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

joined:Mar 31, 2002
votes: 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.



Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members