apache - .htaccess – rewrite all requests to index.php except for files in certain directories -


It really looks like I found the solution, but because .htaccess and mod_rewrite are always confusing, I'm asking for verification I:

I want to rewrite all the traffic in index.php, except those requests, in addition to going to existing directories in some directories. Is this the right solution? ...

  Revoked% {REQUEST_FILENAME}! -f [or] rewrite cnd% {REQUEST_FILENAME}! Css /(.*) | Js /(.*) | Img /(.*) | Media /(.*) rewrite index.php  

I used commonly

  revoked code% {REQUEST_FILENAME}! - d  

removed because I do not want to do directory indexing and there is no subdirectory with index.html or index.php which I have to load.

It all looks like a very simple, safe and simple setup, so I'm asking myself, why I have not seen this before.

You need the conditions exactly:

  rewrite %% {REQUEST_FILENAME}! -f Rewrite Convert% {REQUEST_URI}! ^ / (Css | js | img | media) / [nc] rewriteable index.php [l]  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -