我的网址是这样的:https://myhospital.com/Hospitals-and-Clinics/Hospitals/Hospital-A/Our-Doctors
我尝试此脚本:
<location path="Our-Doctors">
<system.webServer>
<httpRedirect enabled="true" destination="https://www.appointment.myhospital.com/" httpResponseStatus="Permanent" />
</system.webServer>
</location>
在Web配置中
但是它不起作用。它不会重定向到https://www.appointment.myhospital.com/
医院A是医院的名称
所以它可以这样:
https://myhospital.com/Hospitals-and-Clinics/Hospitals/Hospital-B/Our-Doctors
或
https://myhospital.com/Hospitals-and-Clinics/Hospitals/Hospital-C/Our-Doctors
它是动态的
我该如何解决这个问题?
在这种情况下是否使用正则表达式?
<location path="Hospitals-and-Clinics/Hospitals">
您可以使用URL重写模块模块。像这样: