Thursday, November 5, 2009

Use rewriterule with DocumentRoot instead of ProxyPass

When ProxyPass is used on root level with DocumentRoot proxing will dominate and appache will not serve anything from the document directory.

For example if following configuration is used

DocumentRoot /var/www/html/
ProxyPass / ajp://
ProxyPassReverse / ajp://

The content in /var/www/html/ will not be served by appache.

RewriteRule is the way to solve this.

DocumentRoot /var/www/html/

RewriteEngine on
rewriterule ^/blog - [L]
rewriterule ^/(.*) ajp://$1 [P,L]

When the configuration is changed as shown in the above example the content in the folder /var/www/html/blog will be accessible with a URL like http://domain/blog

1 comment:

Anonymous said...

ProxyPass /blog !
ProxyPass / ajp://
ProxyPassReverse / ajp://

Post a Comment