Joshua Slive wrote:
Hmmm. This doesn't seem to have fixed it. The rewrite rules always seem
to get processed before the .htaccess files.
Let's see the actual config.
Here's a slightly cut down version of the VirtualHost in question. The
RewriteMap vhostdir returns a path using the domain name, in /home/web/
<VirtualHost 10.0.0.1:80>
ServerName test.internal.lan
DocumentRoot /var/www/html
<Directory /var/www/html>
AllowOverride None
</Directory>
RewriteEngine On
RewriteOptions MaxRedirects=10
RewriteMap lowercase int:tolower
RewriteMap vhostdir prg:/etc/httpd/rewrite-vhostdir.pl
# Prod php scripts through sbox
RewriteCond %{REQUEST_URI} ^/[^\?]+\.php[34]?(\?.*)?$
RewriteCond %{HTTP_HOST} !^$
RewriteCond ${lowercase:%{HTTP_HOST}|NONE} ^(.+)$
RewriteCond ${vhostdir:%1} ^(/.*)$
RewriteCond %1/$1 -f
RewriteRule ^(/.*)?$ /usr/sbin/sbox-php/%1/$1
[E=VHOST:${lowercase:%{HTTP_HOST}}]
# Figure out the full path for all other requests
RewriteCond %{HTTP_HOST} !^$
RewriteCond ${lowercase:%{HTTP_HOST}|NONE} ^(.+)$
RewriteCond ${vhostdir:%1} ^(/.*)$
RewriteRule ^(/.*)?$ %1/$1 [E=VHOST:${lowercase:%{HTTP_HOST}}]
AddHandler cgi-script .php .php3 .php4
<Directory "/home/web">
AllowOverride AuthConfig FileInfo Indexes Limit
Options FollowSymLinks
</Directory>
# Enable ExecCGI for any file located in the document root ending
.php, .php3 or .php4
<LocationMatch "^[^\?]*\.php[34]?(\?.*)?$" >
SetHandler cgi-script
Options ExecCGI Includes
</LocationMatch>
</VirtualHost>
I am in no way a mod_rewrite expert so there's probably a few
fundemental mistakes in that config anyway, but this gives you an idea
of the effect I'm trying to achieve.
If you try to visit /index.html then it will check for a .htaccess file
in /home/web/blah/blah/domain.com/htdocs/ first. But if you try to visit
/index.php it ends up looking for the .htaccess file in /usr/sbin/ first
which is very frustrating :)
Best wishes,
Mike
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]