How do I exclude CSS, JS, JPG, GIF files from mod_rewrite rules?

前端 未结 4 1091
挽巷
挽巷 2021-01-14 06:26

This is what I have so far:

RewriteRule ^([A-Za-z0-9_]*)/?$ index.php?page=$1 [NC]
RewriteRule ^([A-Za-z0-9_]*)/([A-Za-z0-9_]*)/?$ index.php?page=$1/$2 [NC]
         


        
4条回答
  •  无人共我
    2021-01-14 06:51

    ... it assumes the css is located in /whatever/ssi/*.css.
    I just want to be able to write a condition that says "if it's a css file, don't apply these rules."

    This translates directly to

    RewriteCond %{REQUEST_URI} !^/whatever/ssi/[^/]+\.css$
    RewriteRule ...
    

提交回复
热议问题