开发者

IIS7 301 Redirect from a List of URLs

Recent changes are forcing me to add a bunch of 301 redirects. Seems that IIS7 is my best bet as compared to redirects within the files.

I have found how to add them 1 by 1 but this requires the page/folder to exist (which most don't anymore(and creating them seems to defeat the point of the redirect)) and does not work on dynamic urls. I also cannot go to every page and add the redirects at the page level because some older pages are in php which is no longer supported on the new server. There is also no obvious pattern to the changes so each one must be made on its own.

samples of the redirects

  • page.htm -> /page/
  • /folder/folder/ -> /folder/folder.cfm
  • /folder/folder/ -> /folder/
  • /page.php?id=1 -> page.htm

Edit: I wrote out al开发者_如何转开发l the steps here


The IIS7 rewriting module allows you to specify rules for rewriting and redirecting. It's provided by Microsoft, a free feature of IIS7 and above.

If you have an older version of Windows and IIS, then you can use a third-party rewriter. IIRF is easy and free.

Also, I don't know what you mean by "IIS7 is my best bet". Just so you know, you can't choose your version of IIS independently of your version of Windows. If you have Windows Server 2008, you get IIS7. Windows Server 2008 R2, then IIS7.5. If you have Windows Server 2003, then IIS6. etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜