Configuring httpd.conf to handle wildcard domains and multiple scripts?

Posted by Steve on Pro Webmasters See other posts from Pro Webmasters or by Steve
Published on 2012-07-07T02:04:57Z Indexed on 2012/07/07 3:23 UTC
Read the original article Hit count: 311

I have a full-blown site like:

http://www.example.com (uses index.php)
http://www.example.com/scriptA.php
http://www.example.com/scriptB.php

I now want to have the possibility of setting up subsites like:

http://alpha.example.com
http://alpha.example.com/scriptA.php
http://alpha.example.com/scriptB.php

From http://stackoverflow.com/questions/2844004/subdomain-url-rewriting-and-web-apps/2844033#2844033 , I understand that I have to do:

RewriteCond %{HTTP_HOST} ^([^./]+)\.example\.com$
RewriteCond %1 !=www
RewriteRule ^ index.php?domain=%1

But what about the other scripts like scriptA and scriptB? How do I tell httpd.conf to handle those properly as well?

How can I tell httpd.conf that handle everything after the 'forwardslash', exactly as it does on the main site, but pass a parameter flag like

?domain=alpha

(Cross posted at: http://stackoverflow.com/questions/11365566/configuring-httpd-conf-to-handle-wildcard-domains-and-multiple-scripts)

© Pro Webmasters or respective owner

Related posts about subdomain

Related posts about mod-rewrite