Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a client using a Windows 2012 server with WAMP installed. We use PHP 5.4 with mod_rewrite for SEO friendly URLs. All was working well with them until we tried to enable vhosts to set up a development site in a separate folder on the server under a subdomain.

As soon as I turned on vhosts and created the file every page with an SEO URL started producing 500 internal server errors. Once I'd enabled LogLevel this is what I got in my logs:

[Mon May 19 16:17:19.335990 2014] [rewrite:trace3] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb61a0/initial] [perdir C:/wamp/www/dev_site/] strip per-dir prefix: C:/wamp/www/dev_site/cut-resistant-gloves -> cut-resistant-gloves
[Mon May 19 16:17:19.335990 2014] [rewrite:trace3] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb61a0/initial] [perdir C:/wamp/www/dev_site/] applying pattern '^index\\.php$' to uri 'cut-resistant-gloves'
[Mon May 19 16:17:19.335990 2014] [rewrite:trace3] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb61a0/initial] [perdir C:/wamp/www/dev_site/] strip per-dir prefix: C:/wamp/www/dev_site/cut-resistant-gloves -> cut-resistant-gloves
[Mon May 19 16:17:19.335990 2014] [rewrite:trace3] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb61a0/initial] [perdir C:/wamp/www/dev_site/] applying pattern '(.*)$' to uri 'cut-resistant-gloves'
[Mon May 19 16:17:19.335990 2014] [rewrite:trace2] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb61a0/initial] [perdir C:/wamp/www/dev_site/] rewrite 'cut-resistant-gloves' -> 'handle_url.php'
[Mon May 19 16:17:19.335990 2014] [rewrite:trace3] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb61a0/initial] [perdir C:/wamp/www/dev_site/] add per-dir prefix: handle_url.php -> C:/wamp/www/dev_site/handle_url.php
[Mon May 19 16:17:19.335990 2014] [rewrite:trace1] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb61a0/initial] [perdir C:/wamp/www/dev_site/] internal redirect with C:/wamp/www/dev_site/handle_url.php [INTERNAL REDIRECT]
[Mon May 19 16:17:19.335990 2014] [rewrite:trace3] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb8980/initial/redir#1] [perdir C:/wamp/www/dev_site/] add path info postfix: C:/wamp/www/dev_site/wamp -> C:/wamp/www/dev_site/wamp/www/dev_site/handle_url.php
[Mon May 19 16:17:19.335990 2014] [rewrite:trace3] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb8980/initial/redir#1] [perdir C:/wamp/www/dev_site/] strip per-dir prefix: C:/wamp/www/dev_site/wamp/www/dev_site/handle_url.php -> wamp/www/dev_site/handle_url.php
[Mon May 19 16:17:19.335990 2014] [rewrite:trace3] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb8980/initial/redir#1] [perdir C:/wamp/www/dev_site/] applying pattern '^index\\.php$' to uri 'wamp/www/dev_site/handle_url.php'
[Mon May 19 16:17:19.335990 2014] [rewrite:trace3] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb8980/initial/redir#1] [perdir C:/wamp/www/dev_site/] add path info postfix: C:/wamp/www/dev_site/wamp -> C:/wamp/www/dev_site/wamp/www/dev_site/handle_url.php
[Mon May 19 16:17:19.335990 2014] [rewrite:trace3] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb8980/initial/redir#1] [perdir C:/wamp/www/dev_site/] strip per-dir prefix: C:/wamp/www/dev_site/wamp/www/dev_site/handle_url.php -> wamp/www/dev_site/handle_url.php
[Mon May 19 16:17:19.335990 2014] [rewrite:trace3] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb8980/initial/redir#1] [perdir C:/wamp/www/dev_site/] applying pattern '(.*)$' to uri 'wamp/www/dev_site/handle_url.php'
[Mon May 19 16:17:19.335990 2014] [rewrite:trace2] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb8980/initial/redir#1] [perdir C:/wamp/www/dev_site/] rewrite 'wamp/www/dev_site/handle_url.php' -> 'handle_url.php'
[Mon May 19 16:17:19.335990 2014] [rewrite:trace3] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb8980/initial/redir#1] [perdir C:/wamp/www/dev_site/] add per-dir prefix: handle_url.php -> C:/wamp/www/dev_site/handle_url.php
[Mon May 19 16:17:19.335990 2014] [rewrite:trace1] [pid 4712:tid 1668] mod_rewrite.c(468): [client 5.179.74.249:52121] 5.179.74.249 - - [dev.polycoglovesdirect.com/sid#9d8050][rid#fb8980/initial/redir#1] [perdir C:/wamp/www/dev_site/] internal redirect with C:/wamp/www/dev_site/handle_url.php [INTERNAL REDIRECT]

All the way to 10 redirects. I read up that when you get apache making multiple matches, it can add on unwanted copies of the PATH_INFO, so I tried the DPI flag in my .htaccess file, so this is my file as it stands:

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php
RewriteRule ^index\.php$ / [NC,R=301,L]

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule (.*)$ handle_url.php [DPI,L]

Adding the DPI flag had no effect. It keeps on going through the redirect loop. Please can someone help me fix this? Currently I've had to disable vhosts until I can get this working.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.