重定向到全域 [英] Redirecting to Full Domain

查看:130
本文介绍了重定向到全域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有一个ASP .NET Web应用程序。我在我的应用程序中引用一些交叉领域,因此,当用户访问我的网页,我需要确保他们进入完整的域名。

I currently have a ASP .Net web application. I have some cross domain referencing in my application, so when users visit my page, I need to ensure they enter the full domain name.

因此​​,例如,我需要从重定向

So for example I need to redirect from

http://someserver/someapplication.page.aspx

http://someserver.domain.com/someapplication.page.aspx

我的正则表达式设置搭上URL,如果它不具备domain.com,也不放任何东西后'someserver /',让我们称之为'REGEXMATCH。我只需要知道什么叫内得到充分的领域 -

I have the REGEx set up to catch the URL if it does not have the domain.com, also to hold anything after the 'someserver/', lets call this 'RegExMatch'. I just need to know what to call within to get the Full domain -

Response.Redirect({0}+RegexMatch);

在先进的感谢。

推荐答案

找到了一种方法在应用程序的IIS设置做到这一点。

Found a way to do this in the IIS settings of the Application.

有关任何人有兴趣,下面是详细信息。这就是所谓的URL重写。
http://www.iis.net/learn/extensions / URL重写模块/ SEO规则模板

For anyone that is interested, here are the details. It is called Url Rewrite. http://www.iis.net/learn/extensions/url-rewrite-module/seo-rule-templates.

这篇关于重定向到全域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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