Use ISAPI_Rewrite for redirection?
3 posts
• Page 1 of 1
Use ISAPI_Rewrite for redirection?
I redesigned my client's site and now thousands of links on google/wikipedia, etc go to non-existent pages anymore.
Right now, I just have a custom error handler that redirects them to the Search page of our website. Which is okay, but not great.
What I'd like to do is redirect these non-existent pages to their new correct locations or equivalent pages.
instead of doing <% response.redirect("to-newpage.asp") %> for these missing pages, can I just write IR rules such as
oldfile.asp goes to /directory/newfile.asp
What's the proper regexp for this? if there are any queries passed, it should also pass them? Is this correct?
RewriteRule ^oldfile.asp* /newdirectory/newfile.asp [R=301,QSA,NC]
RewriteRule ^oldfile2.asp* /newdirectory/newfile2.asp [R=301,QSA,NC]
Second question: Is this a bad idea? Will this slow down IR so much because of too many rules?
Is there a better method? Thanks all.
Right now, I just have a custom error handler that redirects them to the Search page of our website. Which is okay, but not great.
What I'd like to do is redirect these non-existent pages to their new correct locations or equivalent pages.
instead of doing <% response.redirect("to-newpage.asp") %> for these missing pages, can I just write IR rules such as
oldfile.asp goes to /directory/newfile.asp
What's the proper regexp for this? if there are any queries passed, it should also pass them? Is this correct?
RewriteRule ^oldfile.asp* /newdirectory/newfile.asp [R=301,QSA,NC]
RewriteRule ^oldfile2.asp* /newdirectory/newfile2.asp [R=301,QSA,NC]
Second question: Is this a bad idea? Will this slow down IR so much because of too many rules?
Is there a better method? Thanks all.
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Use ISAPI_Rewrite for redirection?
Hello,
1.The syntax you provided looks good. but I'd also add [L] flag to the rules. So if it matches the first one, it doesn't look down the config file.
2. Usually a config file of couple mb is okay. But if you have thousands of pages to redirect, it'd be faster to use mapfiles. See FAQ - http://www.helicontech.com/forum/10648-FAQ.html - under "Comprehensive mapfiles"
p.s. Don't forget to use the following on top of your config file:
1.The syntax you provided looks good. but I'd also add [L] flag to the rules. So if it matches the first one, it doesn't look down the config file.
2. Usually a config file of couple mb is okay. But if you have thousands of pages to redirect, it'd be faster to use mapfiles. See FAQ - http://www.helicontech.com/forum/10648-FAQ.html - under "Comprehensive mapfiles"
p.s. Don't forget to use the following on top of your config file:
- Code: Select all
RewriteEngione on
RewriteBase /
Re: Use ISAPI_Rewrite for redirection?
Hi, I have similar issue with a site I support, and I confirm what Andrew is saying: it's much more performant using a mapfile once you have a significant number of redirect rules.
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests