Use ISAPI_Rewrite for redirection?

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 12
Joined: 30 Jan 2014, 19:17

Use ISAPI_Rewrite for redirection?

21 Feb 2014, 14:09

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.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Use ISAPI_Rewrite for redirection?

24 Feb 2014, 10:31

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:
Code: Select all
RewriteEngione on
RewriteBase /

User avatar
Posts: 92
Joined: 01 Dec 2012, 14:22

Re: Use ISAPI_Rewrite for redirection?

25 Feb 2014, 10:08

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.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 0 guests