我正在修改一个使用相当复杂的.htaccess文件来实现自定义MVC类型框架的现有网站,以便将所有网址重定向到index.php?[某些参数]或404页面。我想使用XAJAX向网站的有限区域添加ajax支持,并实现我需要在根中放置两个文件,这些文件被重写规则忽略。我怎么做?
答案 0 :(得分:3)
身份重写规则如何在规则顶部带有“最后”标志?
例如,要从当前规则集中排除“/a-file-outside-of-rewriting.html”,以下配置可能有所帮助:
# 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
# ...