ServerName www.freedom.pliantcode.com
DirectoryIndex index.html
DocumentRoot /pliant/sites/pliantcode.com/
RewriteEngine On
RewriteLogLevel 4
RewriteLog /var/log/apache2/pliantcode-rewrite.log
ProxyVia On
ProxyRequests On
RewriteMap pliant_config prg:/path/to/pliant_config_server.pl
RewriteMap ui_path txt:/path/to/ui_path.txt
# detect right proxy
RewriteRule .* - [E=proxy:http://${pliant_config:proxy}]
RewriteRule .* - [E=browser_key:http://${pliant_config:browser_key}]
RewriteRule .* - [E=active_key:http://${pliant_config:active_key}]
# cache detect:
RewriteCond %{env:browser_key},,,%{HTTP_COOKIE} !(.+?),,,.*SID=\1 [NC]
RewriteCond %{env:active_key},,,%{HTTP_COOKIE} !(.+?),,,.*SID=\1 [NC]
RewriteCond %{env:active_key},%{QUERY_STRING} !(.+),sid=\1
RewriteCond %{env:active_key},,,%{REQUEST_URI} !(.+),,,/_/.*\1
RewriteCond %{QUERY_STRING} !^active
RewriteRule .* - [E=proxy:http://${pliant_config:cache_proxy|%{env:proxy}}]
# cache forced:
RewriteCond %{QUERY_STRING} ^inactive
RewriteRule .* - [E=proxy:http://${pliant_config:cache_proxy|%{env:proxy}}]
RewriteCond %{REQUEST_URI} ^/_/
RewriteRule ^(.*)$ %{env:proxy}$1 [P,L,QSA]
RewriteCond ${ui_path:%{REQUEST_URI}|undef} !^undef$
RewriteRule ^(.*)$ %{env:proxy}/sites/pliantcode.com/${ui_path:$1} [P,L,QSA]
Alias /lib/ /pliant/sites/common/lib/
Order allow,deny
Allow from all
Order allow,deny
Allow from all