apache - Where's that "index.php" coming from after rewrite? -


i added following code htaccess:

rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^(?:.+/)?(\d+)/?$ ?id=$1 [l,qsa] 

the "l"-flag should prevent forthcoming rules apply, don't why url

www.domain.com/a/b/c/d/123

is rewritten to

www.domain.com/index.php?id=123

i'm sure of can enlighten me!

your pattern is:

^(?:.+/)?(\d+)/?$ 

which matching /a/b/c/d in first non-capturing group , capturing 123 in captured group #1.

target ?id=$1 rewriting above url ?id=123.

now index.php default directory index due directoryindex directive hence invoking index.php?id=123.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -