我现在使用:
RewriteEngine on
RewriteRule !^index.html http://samedomain.com [L,R=301]
所以所有的查询都会进入http://samedomain.com ...(通常它会加载index.html) index.html被排除在外,所以它不会陷入无休止的循环。
我可以很好地打开http://samedomain.com/index.html。它不会被重定向。对子页面的其他请求被重定向到http://samedomain.com,但它不会打开该页面。
如果你能告诉我如何将所有请求重定向到http://samedomain.com,以及如何排除2个文件( index.html和image.jpg)从该重新路由排除。
thx chris
发布于 2010-10-22 04:57:08
RewriteCond %{REQUEST_URI} !^/?index\.html$
RewriteCond %{REQUEST_URI} !^/?image\.jpg$
RewriteRule /?(.*) http://samedomain.com/$1 [L]
https://stackoverflow.com/questions/3986426
复制相似问题