2009-12-03 114 views
1

我正在修改一个使用相当复杂的.htaccess文件来实现自定义MVC类型框架的现有网站,以便所有网址都被重定向到index.php?[某些参数]或404页。我想使用XAJAX为网站的有限区域添加ajax支持,并且实现我需要将两个文件放入根重写规则忽略的根目录中。我怎么做?从.htaccess的重写规则中排除文件

回答

3

身份重写规则和规则顶部的“last”标志如何?

例如,要排除当前的一套规则“/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 
# ...