如何使用web.config将所有.asp页面重定向到IIS上的.php页面

as a php programmer, I usually redirect pages with .htaccess, but having inherited a project formerly made with asp, I need to redirect pages to same-named pages in php. For pages that do not exist in php, index.php should be the redirected page.

Would you please help me with some suggestions and resources? I can only find single page to single page redirect.

Thank you very much

First you have to configure the .Net handlers to process your Classic ASP requests You do that with runAllManagedModulesForAllRequests="true" read more here and here

Next, you can use the built in URL rewrite module to do a wild card replace or a one-to-one map via web.config

As a backup, you can use the Global.asax's Application_BeginRequest event to parse out the requested URL and do a permanent redirect to PHP

Hope this helps