ISAPI Rewrite 301 Redirect Mapfile Not Working
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. 开发者_JS百科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
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:
RewriteEngine on
RewriteBase /
RewriteMap mapfilemodels txt:D:/websites/Production/sitename/htdocs/modelredirects.txt
RewriteRule ^(.*) ${mapfilemodels:$1} [R=301,L]
精彩评论