dongshengyin0147 2019-04-18 11:42
浏览 99

如何使用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

  • 写回答

1条回答 默认 最新

  • dongwei3172 2019-04-30 14:45
    关注

    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

    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?