apache - mod_rewrite loops even with L flag -


I have a problem typing the URL in a fastcgi dispatcher if I only leave:

  Rewrite rule ^ (. *) $ Dispatch.fcgi / $ 1 [L, QSA]  

I hope L (last rule) only one Write reason only

I know that can be decided with:

  RewriteCond% {REQUEST_FILENAME}  

}! -FRRITRULY ^ (. *) $ Dispatch.fcgi / $ 1 [L, QSA]

But what is the reason for many re-writing? L Does it feel like doing something else?

I know this is an old question, but the real answer Here's what others search for: [L] flag No .htaccess work in files. It tells the rewrite module to leave all the following rules in that specific .htaccess file. It does its job, writes Apache URL again and exits the .htaccess file.

However, at the end of the .htaccess file If the request URL has been rewritten, then the entire url matching again with the new URL Starts.

This is the same, ^ (. *) $ The current URL will always match , it causes an infinite loop, only < The code> maximum adroid rewrite option (10 by default) stops it.

! -f file attribute test (as outlined by the questioner) Resolve the problem , because the URL will match an actual filename:

< P> Revoked% {REQUEST_FILENAME}! -f

Rewrite rule ^ (. *) $ Dispatch.fcg / $ 1 [L, QSA]

Now, if we go to http: // Example.com/toappend , then .htaccess is sent to sending .fcgi / toappend and does not send a rewrite loop .

L

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -