jeudi 30 avril 2015

Loading a controller on a subdomain using mod_rewrite

I'm trying to load a controller from my MVC on a subdomain. So for example, I want to load the contents of /affiliates/something on test.domain.com thus http://ift.tt/1GIbpsR

Options +FollowSymLinks
Options +Indexes
RewriteEngine On 

RewriteBase /

RewriteCond %{HTTP_HOST} !^solvex
RewriteCond %{HTTP_HOST} ([^.]+)\.solvex 
RewriteRule ^(.*)$ /affiliates/agents_sites/?subdomain=%1 [L]

RewriteCond %{REQUEST_FILENAME} !(/web/)
RewriteCond %{REQUEST_FILENAME} !(/html/)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* web/bootstrap.php [QSA,L]

However, on the following line:

RewriteRule ^(.*)$ /affiliates/agents_sites/?subdomain=%1 [L]

When I remove the [L] flag it does not work but with the [L] flag it runs into an Internal Server Error.

Aucun commentaire:

Enregistrer un commentaire