On my shared hosting server (Hostmonster) I have django (actually pinax) setup so that a .htaccess mod_rewrite rule rewrites the request to a pinax.fcgi file:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ pinax.fcgi/$1 [QSA,L]
What I would like to do is have a different pinax.fcgi file get called depending on the domain used (or subdomain), something like this:
RewriteCond %{HTTP_HOST} ^subdomain\.domain\.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ pinax2.fcgi/$1 [QSA,L]
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ pinax.fcgi/$1 [QSA,L]
This is stored in a .htaccess file in my ROOT public_html folder (not in the public_html/subdomain/ folder), but unfortunately just results in internal redirect errors. How can I write these rules so that they use a different fcgi file for different domains?
I figured it out.
In the root .htaccess (in public_html) put:
In your subdomain .htaccess (in public_html/subdomain) put:
pinax2.fcgi needs to be in the public_html/subdomain/ directory, and pinax.fcgi should be in public_html/