我在网页上使用 mod_rewrite 来正确处理友好 URL。它在 FF、Chrome 和 Safari 中运行良好,但在 IE 中,友好 URL 一直出现 404 错误(它没有正确处理重写,因此显示为 404)。
有人遇到过这种情况吗?如果有,如何解决?
注意:我已清除缓存、cookie 和会话,并重新启动了浏览器。我使用的是 IE 9,但也尝试过 IE7 和 8,使用开发人员工具,在任何 IE 模式下都无济于事。另外需要注意的是,IE 可以重写某些页面,但对于其他页面则不起作用。
例子
用户访问:
www.mysite.com/products/99-shoes.html
服务器将从这里解释并提供页面:
www.mysite.com/product.php?id_product=99
下面是我在 .htaccess 中使用的指令类型的示例:
<IfModule mod_rewrite.c>
# URL rewriting module activation
RewriteEngine on
RewriteRule ^products/([0-9]+)-[a-zA-Z0-9-]*.html /product.php?id_product=$1 [QSA,L]
</IfModule>
# Catch 404 errors
ErrorDocument 404 /404.php
更新:额外信息
根据要求,我在下面提供了我的 RewriteLog。第一个是我在 Chrome 上访问页面时的输出(工作正常)。第二个是我在 IE 中访问页面时的输出。我尝试加载的页面是: http://localhost/products-fb/10-loop.html。我删除了一些重复的字符和时间戳,以遵守 StackOverflow 的 30k 字符限制。如果您认为我可能删除了一些重要内容,请告诉我,我可以上传 .txt 文件供您查看。
Chrome 日志输出
(2) init rewrite engine with requested uri /products-fb/10-loop.html
(1) pass through /products-fb/10-loop.html
(3) [perdir C:/www/] add path info postfix: C:/www/products-fb -> C:/www/products-fb/10-loop.html
(3) [perdir C:/www/] strip per-dir prefix: C:/www/products-fb/10-loop.html -> products-fb/10-loop.html
(3) [perdir C:/www/] applying pattern '^api/?(.*)$' to uri 'products-fb/10-loop.html'
(3) [perdir C:/www/] add path info postfix: C:/www/products-fb -> C:/www/products-fb/10-loop.html
(3) [perdir C:/www/] strip per-dir prefix: C:/www/products-fb/10-loop.html -> products-fb/10-loop.html
(3) [perdir C:/www/] applying pattern '^([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'products-fb/10-loop.html'
(3) [perdir C:/www/] add path info postfix: C:/www/products-fb -> C:/www/products-fb/10-loop.html
(3) [perdir C:/www/] strip per-dir prefix: C:/www/products-fb/10-loop.html -> products-fb/10-loop.html
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'products-fb/10-loop.html'
(3) [perdir C:/www/] add path info postfix: C:/www/products-fb -> C:/www/products-fb/10-loop.html
(3) [perdir C:/www/] strip per-dir prefix: C:/www/products-fb/10-loop.html -> products-fb/10-loop.html
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'products-fb/10-loop.html'
(3) [perdir C:/www/] add path info postfix: C:/www/products-fb -> C:/www/products-fb/10-loop.html
(3) [perdir C:/www/] strip per-dir prefix: C:/www/products-fb/10-loop.html -> products-fb/10-loop.html
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'products-fb/10-loop.html'
(3) [perdir C:/www/] add path info postfix: C:/www/products-fb -> C:/www/products-fb/10-loop.html
(3) [perdir C:/www/] strip per-dir prefix: C:/www/products-fb/10-loop.html -> products-fb/10-loop.html
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'products-fb/10-loop.html'
(3) [perdir C:/www/] add path info postfix: C:/www/products-fb -> C:/www/products-fb/10-loop.html
(3) [perdir C:/www/] strip per-dir prefix: C:/www/products-fb/10-loop.html -> products-fb/10-loop.html
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'products-fb/10-loop.html'
(3) [perdir C:/www/] add path info postfix: C:/www/products-fb -> C:/www/products-fb/10-loop.html
(3) [perdir C:/www/] strip per-dir prefix: C:/www/products-fb/10-loop.html -> products-fb/10-loop.html
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'products-fb/10-loop.html'
(3) [perdir C:/www/] add path info postfix: C:/www/products-fb -> C:/www/products-fb/10-loop.html
(3) [perdir C:/www/] strip per-dir prefix: C:/www/products-fb/10-loop.html -> products-fb/10-loop.html
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'products-fb/10-loop.html'
(3) [perdir C:/www/] add path info postfix: C:/www/products-fb -> C:/www/products-fb/10-loop.html
(3) [perdir C:/www/] strip per-dir prefix: C:/www/products-fb/10-loop.html -> products-fb/10-loop.html
(3) [perdir C:/www/] applying pattern '^c/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$' to uri 'products-fb/10-loop.html'
(3) [perdir C:/www/] add path info postfix: C:/www/products-fb -> C:/www/products-fb/10-loop.html
(3) [perdir C:/www/] strip per-dir prefix: C:/www/products-fb/10-loop.html -> products-fb/10-loop.html
(3) [perdir C:/www/] applying pattern '^c/([a-zA-Z-]+)/[a-zA-Z0-9-]+\.jpg$' to uri 'products-fb/10-loop.html'
(3) [perdir C:/www/] add path info postfix: C:/www/products-fb -> C:/www/products-fb/10-loop.html
(3) [perdir C:/www/] strip per-dir prefix: C:/www/products-fb/10-loop.html -> products-fb/10-loop.html
(3) [perdir C:/www/] applying pattern '^([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri 'products-fb/10-loop.html'
(3) [perdir C:/www/] add path info postfix: C:/www/products-fb -> C:/www/products-fb/10-loop.html
(3) [perdir C:/www/] strip per-dir prefix: C:/www/products-fb/10-loop.html -> products-fb/10-loop.html
(3) [perdir C:/www/] applying pattern '^products-fb/([0-9]+)-[a-zA-Z0-9-]*.html' to uri 'products-fb/10-loop.html'
(2) [perdir C:/www/] rewrite 'products-fb/10-loop.html' -> '/product-fb.php?id_product=10'
(3) split uri=/product-fb.php?id_product=10 -> uri=/product-fb.php, args=id_product=10
(1) [perdir C:/www/] internal redirect with /product-fb.php [INTERNAL REDIRECT]
(2) init rewrite engine with requested uri /product-fb.php
(1) pass through /product-fb.php
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^api/?(.*)$' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^c/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^c/([a-zA-Z-]+)/[a-zA-Z0-9-]+\.jpg$' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^products-fb/([0-9]+)-[a-zA-Z0-9-]*.html' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)\-[a-zA-Z0-9-]*' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^products-fb/[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)__([a-zA-Z0-9-]*)' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)_([a-zA-Z0-9-]*)' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^content/([0-9]+)\-([a-zA-Z0-9-]*)' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^content/category/([0-9]+)\-([a-zA-Z0-9-]*)' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$' to uri 'product-fb.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/product-fb.php -> product-fb.php
(3) [perdir C:/www/] applying pattern '^page-not-found$' to uri 'product-fb.php'
(1) [perdir C:/www/] pass through C:/www/product-fb.php
(2) init rewrite engine with requested uri /cart.php
(1) pass through /cart.php
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^api/?(.*)$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^c/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^c/([a-zA-Z-]+)/[a-zA-Z0-9-]+\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^products-fb/([0-9]+)-[a-zA-Z0-9-]*.html' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)\-[a-zA-Z0-9-]*' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^products-fb/[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)__([a-zA-Z0-9-]*)' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)_([a-zA-Z0-9-]*)' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^content/([0-9]+)\-([a-zA-Z0-9-]*)' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^content/category/([0-9]+)\-([a-zA-Z0-9-]*)' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^page-not-found$' to uri 'cart.php'
(1) [perdir C:/www/] pass through C:/www/cart.php
IE 日志输出
(2) init rewrite engine with requested uri /page-not-found
(1) pass through /page-not-found
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^api/?(.*)$' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^c/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^c/([a-zA-Z-]+)/[a-zA-Z0-9-]+\.jpg$' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^products-fb/([0-9]+)-[a-zA-Z0-9-]*.html' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^([0-9]+)\-[a-zA-Z0-9-]*' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^products-fb/[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^([0-9]+)__([a-zA-Z0-9-]*)' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^([0-9]+)_([a-zA-Z0-9-]*)' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^content/([0-9]+)\-([a-zA-Z0-9-]*)' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^content/category/([0-9]+)\-([a-zA-Z0-9-]*)' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$' to uri 'page-not-found'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/page-not-found -> page-not-found
(3) [perdir C:/www/] applying pattern '^page-not-found$' to uri 'page-not-found'
(2) [perdir C:/www/] rewrite 'page-not-found' -> '/404.php'
(1) [perdir C:/www/] internal redirect with /404.php [INTERNAL REDIRECT]
(2) init rewrite engine with requested uri /404.php
(1) pass through /404.php
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^api/?(.*)$' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^c/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^c/([a-zA-Z-]+)/[a-zA-Z0-9-]+\.jpg$' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^products-fb/([0-9]+)-[a-zA-Z0-9-]*.html' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)\-[a-zA-Z0-9-]*' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^products-fb/[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)__([a-zA-Z0-9-]*)' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)_([a-zA-Z0-9-]*)' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^content/([0-9]+)\-([a-zA-Z0-9-]*)' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^content/category/([0-9]+)\-([a-zA-Z0-9-]*)' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^page-not-found$' to uri '404.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/404.php -> 404.php
(3) [perdir C:/www/] applying pattern '^address$' to uri '404.php'
(1) [perdir C:/www/] pass through C:/www/404.php
(2) init rewrite engine with requested uri /cart.php
(1) pass through /cart.php
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^api/?(.*)$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^c/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^c/([a-zA-Z-]+)/[a-zA-Z0-9-]+\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^products-fb/([0-9]+)-[a-zA-Z0-9-]*.html' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)\-[a-zA-Z0-9-]*' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^products-fb/[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)__([a-zA-Z0-9-]*)' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)_([a-zA-Z0-9-]*)' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^content/([0-9]+)\-([a-zA-Z0-9-]*)' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^content/category/([0-9]+)\-([a-zA-Z0-9-]*)' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$' to uri 'cart.php'
(3) [perdir C:/www/] strip per-dir prefix: C:/www/cart.php -> cart.php
(3) [perdir C:/www/] applying pattern '^page-not-found$' to uri 'cart.php'
(1) [perdir C:/www/] pass through C:/www/cart.php
答案1
这是一个非常有趣的问题。
我可以请您在问题中添加重写日志和重写错误吗?
以下是我通常的提示:
请尝试使用该RewriteLog
指令:它可以帮助您追踪此类问题:
# Trace:
# (!) file gets big quickly, remove in prod environments:
RewriteLog "/web/logs/mywebsite.rewrite.log"
RewriteLogLevel 9
RewriteEngine On
我最喜欢的检查正则表达式的工具:
http://www.quanetic.com/Regex(不要忘记选择 ereg(POSIX)而不是 preg(PCRE)!)
我可以请您在问题中添加重写日志和重写错误吗?
答案2
经过两天的折腾,解决方案并不令人满意,似乎是 IE9 中的一些错误。我使用开发人员工具面板,将“工具”>“更改用户代理字符串”从“默认”更改为“Google Chrome”。然后页面加载正常。一旦我将用户代理字符串重新设置为“默认”,页面仍会加载正常。我真的不知道发生了什么或为什么会发生这种情况,因为我以前从未摆弄过这些设置,但我想将它发布给其他可能遇到这种情况的人。