exclude files from rewrite rule in .htaccess

前端 未结 1 428
小鲜肉
小鲜肉 2021-01-25 10:33

I\'m modifying an existing website that uses a fairly complex .htaccess file to implement a custom MVC type framework so all urls are redirected to index.php?[some parameters] o

相关标签:
1条回答
  • 2021-01-25 11:06

    How about identity rewriting rule with “last” flag on the top of your rules?

    For example, to exclude “/a-file-outside-of-rewriting.html” from current set of rules, the following configuration might help:

    # http://~/outside-of-rewriting.html will be rewritten to itself (i.e., unmodified).
    # then no more rules will be applied (because it has “last” flag.)
    RewriteRule ^/a-file-outside-of-rewriting.html$ $0 [L]
    
    RewriteRule ^/any/other/rules(/.*) $1
    RewriteRule ^/already/exist(/.*) $1
    # ...
    
    0 讨论(0)
提交回复
热议问题