Forum Moderators: phranque

Message Too Old, No Replies

Redirect to subfolder depending on subdomain

Redirection to subfolders based on subdomain

         

Maribelle

2:55 am on Aug 16, 2009 (gmt 0)

10+ Year Member



Hello,

I have wildcard enabled on my server and I'm trying to accomplish the following behavior:

Each subdomain must point to a subfolder like this:
[subdomain1.domain.com...] --> [subdomain1.domain.com...]

[subdomain2.domain.com...] --> [subdomain2.domain.com...]

But display and be accessed as:
[subdomain1.domain.com...]
[subdomain2.domain.com...]

Is there a way to accomplish this?

Thanks in advance,
Maribelle

g1smd

4:54 pm on Aug 16, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Either define those folders as the DocumentRoot in your httpd.conf file, or set up an internal rewrite to translate the requested URL into the correct internal server filepath.

There was a question on this, with detailed answers, in just the last few days if you cast your eye over recent threads.

jdMorgan

2:46 pm on Aug 17, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Each subdomain must point to a subfolder...

But display and be accessed as:
http://subdomain1.example.com/subfolder
http://subdomain2.example.com/subfolder

In most cases, Webmasters want the subfolder to be accessed when the subdomain is requested, but they do not want that subdirectory path to be displayed (revealed) to clients (browsers and search engines).

If the subdirectory is revealed to clients, then those subdirectories will be listed in search results instead of the subdomains -- and this effectively defeats the purpose of using subdomains.

There are many previous examples here of implementing subdomain to subdirectory rewrites. Try a search [google.com] on WebmasterWorld for "subdomain subdirectory rewrite rewritecond http_host" to get started.

Jim