ISAPI 重写 301 重定向映射文件不起作用
我有 10K 的重定向用于重新设计一个大型的新网站,但我无法将它们粘贴到 ISAPI 编辑器中 - 当我单击“应用”时它就会死掉,并且我得到一个无响应的程序,Windows 将其关闭。它们通常是 301 旧网址到新网址(就像这样)
RewriteRule ^models/308.htm$ /peugeot-308/ [R=301,L]
RewriteRule ^models/4007.htm$ /peugeot-4007/ [R=301,L]
我正在尝试将其作为映射文件选项,但它没有获取 txt 文件中的任何 301 重定向?这就是我所拥有的
RewriteEngine on
RewriteBase /
RewriteMap mapfilemodels txt:D:\websites\Production\sitename\htdocs\modelredirects.txt
RewriteRule ^/(.*) ${mapfilemodels:$1} [R=301,L]
,在我的文本文件中我有以下旧网址和新网址?
m/alfa-romeo-page.htm /alfa-romeo/
m/ford-page.htm /ford/
models/308.htm /peugeot-308/
models/301.htm /peugeot-301/
知道为什么这不起作用吗?或者任何其他想法如何让这些到位
I have 10K of redirects for a large new site redesign and I cannot paste them in the ISAPI editor - It just dies when I click 'Apply' and I get a non responsive program and windows closes it. They are usual 301 old url to new (Like this)
RewriteRule ^models/308.htm$ /peugeot-308/ [R=301,L]
RewriteRule ^models/4007.htm$ /peugeot-4007/ [R=301,L]
I am trying this as a mapfile option but its not picking up any of the 301 redirects in the txt file? This is what I have
RewriteEngine on
RewriteBase /
RewriteMap mapfilemodels txt:D:\websites\Production\sitename\htdocs\modelredirects.txt
RewriteRule ^/(.*) ${mapfilemodels:$1} [R=301,L]
And in my text file I have the following old urls and new urls?
m/alfa-romeo-page.htm /alfa-romeo/
m/ford-page.htm /ford/
models/308.htm /peugeot-308/
models/301.htm /peugeot-301/
Any idea why this isn't working? Or any other idea how I can get these in place
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以尝试的几个想法:
1. 在声明重写地图文件的绝对路径时,使用
/
而不是\
。老实说,这应该可以以任何方式工作..但是,至少,这是在 ISAPI_Rewrite 示例中完成的。2. 我认为这种模式有点错误
^/(.*)
——我认为这里不需要前导斜杠。考虑到上述所有内容,请尝试以下操作:
Few ideas to try:
1. Use
/
instead of\
when declaring absolute path to rewrite map file. TBH this should work either way .. but, at least, this is how it is done in ISAPI_Rewrite examples.2. I think this pattern is a bit wrong
^/(.*)
-- I do not think you need leading slash here.Considering all aforementioned, try this: