是否可以在页面加载后重写域名 [英] Is it possible to rewrite the domain name after page load

查看:74
本文介绍了是否可以在页面加载后重写域名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道,是否有可能在页面加载后重写域名



示例:



用户打开:http://www.MyWebsite.com/Home.aspx



页面加载后网址应为-http:// NewMyWebsite。 com / Home.aspx



如果可能,请给我学习资料来源。



:)

I just want to know that, Is it possible to rewrite the domain name after page load

Example:

User Opens: http://www.MyWebsite.com/Home.aspx

After page load url should be -http://NewMyWebsite.com/Home.aspx

Please give me the source to study also if it is possible.

:)

推荐答案

执行此操作不需要代码。您可以通过web.config处理此问题。



There is no code required to do this. You can deal with this via the web.config.

<system.webserver>
<rule name="Remove WWW" patternsyntax="Wildcard" stopprocessing="true">
  <match url="*" />
  <conditions>
    <add input="{CACHE_URL}" pattern="*://www.*" />
  </conditions>
  <action type="Redirect" url="{C:1}://{C:2}" redirecttype="Permanent" />
</rule>
</system.webserver>


这篇关于是否可以在页面加载后重写域名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆