RewriteRule导致403

时间:2018-05-16 04:24:38

标签: apache .htaccess redirect mod-rewrite

我从webarchive恢复了一个网站,因此它的文件名为:

blog.html
blog.html%3fstart%3d10
blog.html%3fstart%3d20
blog.html%3fstart%3d30

分页正在处理像blog.html?start = 10等链接。

所以我需要简单的重定向。我的.htaccess看起来如下,但得到403错误。

RewriteEngine On
RewriteCond %{QUERY_STRING} ^start=([0-9]+)$
RewriteRule ^(.*)$ /blog.html\%253fstart\%253d%1 [L]

但是我收到500错误(在apache日志中看到它是无限内部重定向),这里是完整的apache日志:

strip per-dir prefix: F:/OSPanel/domains/test3/blog.html -> blog.html
applying pattern '^(.*)$' to uri 'blog.html'
rewrite 'blog.html' -> '/blog.html%253fstart%253d10'
trying to replace context docroot F:/OSPanel/domains/test3 with context prefix 
internal redirect with /blog.html%253fstart%253d10 [INTERNAL REDIRECT]
strip per-dir prefix: F:/OSPanel/domains/test3/blog.html%3fstart%3d10 -> blog.html%3fstart%3d10
applying pattern '^(.*)$' to uri 'blog.html%3fstart%3d10'
rewrite 'blog.html%3fstart%3d10' -> '/blog.html%253fstart%253d10'
trying to replace context docroot F:/OSPanel/domains/test3 with context prefix 
internal redirect with /blog.html%253fstart%253d10 [INTERNAL REDIRECT]
strip per-dir prefix: F:/OSPanel/domains/test3/blog.html%3fstart%3d10 -> blog.html%3fstart%3d10
applying pattern '^(.*)$' to uri 'blog.html%3fstart%3d10'
rewrite 'blog.html%3fstart%3d10' -> '/blog.html%253fstart%253d10'
trying to replace context docroot F:/OSPanel/domains/test3 with context prefix 
internal redirect with /blog.html%253fstart%253d10 [INTERNAL REDIRECT]

最后一个重复10次 我做错了什么?

0 个答案:

没有答案