tl;dr: add DirectoryIndex disabled
I made a pull request for your convenience ;) https://github.com/rubenarslan/formr.org/pull/82
A little late, but i stubled into this problem today not on XAMPP but Apache 2.4.7 on Ubuntu 14.04.1 ...
After looking at the debugging output of Apache/rewrite it looks like Apache is trying index files instead of using the correct rewrite. So my solution ( or more likely workaround :) is to disable DirectoryIndex for the survey and run directory:
/webroot/admin/run/.htaccess
:
<IfModule mod_rewrite.c>
DirectoryIndex disabled
RewriteEngine On
RewriteRule ^/?$ add_run.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?([A-Za-z0-9_]+)/?$ index.php?run_name=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php !-d
RewriteCond %{REQUEST_FILENAME}.php !-f
RewriteRule ^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)/?$ $2.php?run_name=$1 [QSA,L]
# on HU subdomain
# RewriteBase /survey/admin/run/
</IfModule>
/webroot/admin/survey/.htaccess
:
<IfModule mod_rewrite.c>
DirectoryIndex disabled
RewriteEngine On
RewriteRule ^/?$ add_survey.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?([A-Za-z0-9_]+)/?$ index.php?study_name=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php !-d
RewriteCond %{REQUEST_FILENAME}.php !-f
RewriteRule ^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)/?$ $2.php?study_name=$1 [QSA,L]
# on HU subdomain
# RewriteBase /survey/admin/survey/
</IfModule>
For those of you who are into this kind of kinky stuff and maybe can help gaining deeper understanding - the debug logs:
strip per-dir prefix: /var/www/formr/webroot/admin/survey/ ->
applying pattern '^/?$' to uri ''
rewrite '' -> 'add_survey.php'
add per-dir prefix: add_survey.php -> /var/www/formr/webroot/admin/survey/add_survey.php
looks fine... but wait...
strip document_root prefix: /var/www/formr/webroot/admin/survey/add_survey.php -> /admin/survey/add_survey.php
internal redirect with /admin/survey/add_survey.php [INTERNAL REDIRECT]
now let's just try index.html instead
strip per-dir prefix: /var/www/formr/webroot/admin/survey/index.html -> index.html
applying pattern '^/?$' to uri 'index.html'
strip per-dir prefix: /var/www/formr/webroot/admin/survey/index.html -> index.html
applying pattern '^/?([A-Za-z0-9_]+)/?$' to uri 'index.html'
strip per-dir prefix: /var/www/formr/webroot/admin/survey/index.html -> index.html
applying pattern '^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)/?$' to uri 'index.html'
pass through /var/www/formr/webroot/admin/survey/index.html
and .cgi ... not seen this for some time...
strip per-dir prefix: /var/www/formr/webroot/admin/survey/index.cgi -> index.cgi
applying pattern '^/?$' to uri 'index.cgi'
strip per-dir prefix: /var/www/formr/webroot/admin/survey/index.cgi -> index.cgi
applying pattern '^/?([A-Za-z0-9_]+)/?$' to uri 'index.cgi'
strip per-dir prefix: /var/www/formr/webroot/admin/survey/index.cgi -> index.cgi
applying pattern '^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)/?$' to uri 'index.cgi'
pass through /var/www/formr/webroot/admin/survey/index.cgi
and .pl ...
strip per-dir prefix: /var/www/formr/webroot/admin/survey/index.pl -> index.pl
applying pattern '^/?$' to uri 'index.pl'
strip per-dir prefix: /var/www/formr/webroot/admin/survey/index.pl -> index.pl
applying pattern '^/?([A-Za-z0-9_]+)/?$' to uri 'index.pl'
strip per-dir prefix: /var/www/formr/webroot/admin/survey/index.pl -> index.pl
applying pattern '^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)/?$' to uri 'index.pl'
pass through /var/www/formr/webroot/admin/survey/index.pl
and last but not least .php ... oohh ... look... index.php...
strip per-dir prefix: /var/www/formr/webroot/admin/survey/index.php -> index.php
applying pattern '^/?$' to uri 'index.php'
strip per-dir prefix: /var/www/formr/webroot/admin/survey/index.php -> index.php
applying pattern '^/?([A-Za-z0-9_]+)/?$' to uri 'index.php'
strip per-dir prefix: /var/www/formr/webroot/admin/survey/index.php -> index.php
applying pattern '^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)/?$' to uri 'index.php'
pass through /var/www/formr/webroot/admin/survey/index.php