将外部 URL 重定向到退出页面
将请求外部 URL 的用户重定向到某种告别页面的最佳方法是什么?
我知道我可以努力安装某种类似 mod_rewrite 的模块。但我不能在 global.asax 或母版页中执行某种 Page_OnRequest 类型的函数吗?
What would be the best way to redirect users who request an external URL, to a sort of good-bye page?
I know I could work hard to install some sort of mod_rewrite-like module. But can't I do some sort of Page_OnRequest type function in global.asax or the master pages?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以让这些 url 实际上指向您自己网站上的重定向页面,然后再将它们转发到最终目的地:
然后您可以对重定向执行任何您想要的操作,并且可以进行重定向,以便重定向隐藏 url,对其进行编码、添加参数等
You could have these urls actually point to a redirection page on your own site before forwarding them on to the ultimate destination:
Then you could do whatever you wanted with the redirection, and it could be worked so that the redirection hid the url, encoded it, added parameters, etc.
最简单的方法是使用 jQuery 挂钩页面上所有标签上的单击事件:
任何被单击的链接都会触发事件处理程序。外部 URL 将导致页面 Outside_link.aspx 加载查询字符串中的目标 URL。内部 URL 将正常运行。
简单的。
Easiest way is to use jQuery to hook the click event on all the tags on the page:
Any link that gets clicked fires the event handler. External URLs will cause the page outside_link.aspx to loaded with the destination url in the query string. Internal URLs will behave normally.
Simple.