Regex 使用正则表达式重写IIS7 URL
当用户访问我网站的某个URL时,我正在尝试进行URL重写:Regex 使用正则表达式重写IIS7 URL,regex,iis-7,url-rewriting,Regex,Iis 7,Url Rewriting,当用户访问我网站的某个URL时,我正在尝试进行URL重写: Accessed URL: https://client1.domain.com Rewritten URL: https://new-client1.otherdomain.com 我的站点有许多指向它的URL,因此简单的HTTP重定向模块将不是有效的解决方案。正则表达式是什么?在重写规则中,我希望为每个部分填写什么 谢谢试试这个: s/client1.domain/new-client1.otherdomain/g 您可以使用
Accessed URL: https://client1.domain.com
Rewritten URL: https://new-client1.otherdomain.com
我的站点有许多指向它的URL,因此简单的HTTP重定向模块将不是有效的解决方案。正则表达式是什么?在重写规则中,我希望为每个部分填写什么
谢谢试试这个:
s/client1.domain/new-client1.otherdomain/g
您可以使用此正则表达式模式搜索
client1.domain
,以替换它:
(?<=//)([^.]+)\.domain
不幸的是,我两个都没能用。
$1\.otherdomain