Q: missing something obvious in .htaccess rewrite My goals are simple:


*

*anything strating with with /special should go to /SpecialHandler.php

*everything else should go to /index.php
My basic configuration is written like this but it doesn't work:
RewriteEngine on
RewriteBase /
RewriteRule ^/special(.*)/?$ SpecialHandler.php [L,NC]
RewriteRule ^.*/?$ index.php [L]

The following is what is happening:


*

*localhost - works fine

*localhost/bla_bla-bla%20bla - works fine

*localhost/special/ - goes to index.php instead of SpecialHandler.php

*localhost/special/fu/bar/bat -  goes to index.php instead of SpecialHandler.php
This has got to be something obvious that I'm missing.

A: Remove the first / of the special rule : 
RewriteRule ^special(.*)/?$ SpecialHandler.php [L,NC]

it should work
-- complete working htaccess 
RewriteEngine on
RewriteBase /a/
RewriteRule ^special(.*)/? SpecialHandler.php [NC,L]
RewriteRule ^.*/?$ index.php [L]

url : 
http://localhost/a/special => special
http://localhost/a/special/really => special
http://localhost/a/index.php => index
http://localhost/a/foobarbaz => index

