I currently have two projects:
- /home/piotrek/Vhosts/sf.local/web/app_dev.php
- /home/piotrek/Vhosts/sf2.local/web/app_dev.php
Both have same repo but are set to two different branches.
I have vhost for first site:
<VirtualHost *:80>
ServerName sf.local
ServerAlias www.sf.local
DocumentRoot /home/piotrek/Vhosts/sf.local/web
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9071/home/piotrek/Vhosts/sf.local/web/$1
DirectoryIndex app_dev.php
<Directory /home/piotrek/Vhosts/sf.local/web>
AllowOverride All
Require all granted
Options -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app_dev.php [QSA,L]
</IfModule>
</Directory>
ErrorLog /home/piotrek/Vhosts/logs/sf.local-error.log
CustomLog /home/piotrek/Vhosts/logs/sf.local-access.log combined
</VirtualHost>
When I request http://sf.local/ everything works fine. But now I want to send people to /sf2.local/ when there is cookie with name THEME
set. Something like this:
RewriteCond %{HTTP_COOKIE} THEME=new [NC]
RewriteRule ^(.*)$ sf2project
How can I combine mod rewrite with fastcgi proxy to server one site when there is no cookie and other when there is cookie set?