Welcome to WebmasterWorld Guest from 184.108.40.206 , register , free tools , login , search , subscribe , help , library , announcements , recent posts , open posts Pubcon Website
PHP and mod_rewrite for internal redirect of subdomains Variable msg:1286873 8:55 pm on Dec 15, 2004 (gmt 0) I am trying to route subdomains to different directories based on whether the subdomain is in a mysql db. I am accepting all subdomains via domain wildcarding and I need to route all the invalid subdomains(not in db) to one directory and all the valid ones(in db) to another directory.
Can I do the internal redirect that mod_rewrite offers in PHP?
www.example.com -> / validsub1.example.com -> /validsubs/ validsub2.example.com -> /validsubs/ invalidsub1.example.com -> /invalidsubs/ invalidsub2.example.com -> /invalidsubs/
If I can't do this in PHP, is there a way to check a mysql database and incorporate the result into a conditional for mod_rewrite?
jatar_k msg:1286874 6:33 am on Dec 17, 2004 (gmt 0)
>> is there a way to check a mysql database and incorporate the result into a conditional for mod_rewrite
I really am not sure. The logical situation I see is this,
all requests for subdomains go to a script
script checks to see if they exist in db scripts redirects/includes the proper things
I don't like the thought of all the redirects frankly, seems like it might cause some issues with the SEO side of things. I am not really sure about the rewrite side of it though.