Forum Moderators: phranque

Message Too Old, No Replies

subdomain.domain.com redirect

         

zarti

6:48 pm on Mar 17, 2007 (gmt 0)

10+ Year Member



Hi. I'm really newby to mod_rewrite. I've read lots of posts about the subdomain rewrites/redirects but I failed to implement somewhat 100% working on my site.
What I want to achieve is (both with and without www) subdomain.domain.com redirect to domain.com/subdomain/any.php, so that address bar is still showing subdomain.domain.com.
Together with this any file located in domain.com/subdomain/any.php can be directly addressed from subdomain.domain.com/any.php
Please give me some clue about this.

Discovery

7:22 am on Mar 20, 2007 (gmt 0)

10+ Year Member



Using .htaccess
All request from subdomain(with greater than 3 characters) should go to discovery folder. Example subdomain.abc.com will fetch all the required files from name/discovery/ (discovery folder).

RewriteCond %{HTTP_HOST}!^www\.abc\.com[NC]
RewriteCond %{HTTP_HOST} ^([a-zA-Z0-9]{3,})\.abc\.com
RewriteRule (.*) name/discovery/$1 [L]

jdMorgan

6:54 pm on Mar 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See this previous thread [webmasterworld.com] on the subject.

Jim