regex - Apache - RewriteRule "$(.*)^" pattern doesn't work with empty requests -


i'm trying url rewriting apache2 , php, problem made .htaccess file uses rewrite_mod, here is:

rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ webroot/index.php [qsa,l] 

the ^(.*)$ pattern should match everything, doesn't match empty requests, , don't know why.

to give exemple, here /root folder .htaccess file is.

  • request /root/anything matches;
  • request /root/some/thing matches too;
  • request /root/ doesn't match.

here, /root/ request should match pattern ^(.*)$ means "match characters 0 times amount of times".

does know why doesn't match empty requests?

i'm running lamp under linux mint.

have rules this:

rewriteengine on  # handles landing page rewriterule ^/?$ webroot/index.php [l]  # handles rest rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . webroot/index.php [l] 

mod_dir module if runs before mod_rewrite , adds directoryindex handler landing page i.e. /index.php blocking execution of rule due rewritecond %{request_filename} !-f condition.


Comments