一种URL重写。 [英] Kind of URL Rewriting.

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

问题描述





我在许多网站上看到过,例如,如果我们访问的是该网站名为博客的网页,则使用的是浏览器中显示的网址就像www.sitename.com/blog而如果我们想要,我们也可以通过输入blog.sitename.com来访问同一页面... 。



如何在.net框架上的Visual Studio中创建和实现此功能。





任何人都可以帮助这个Regard。??





问候,




:)

解决方案

有几种方法可以重写URL。 />


我们可以使用IIS的URLRewrite模块从IIS设置重写URL。



我们可以从以下位置重写URL global.asax文件。



Referance如下:

http://www.iis.net/learn/extensions/url-rewrite-module/iis-url-rewriting-and-aspnet-routing [ ^ ]

http://blog.dotnettechy.com/2011/09/url -rewriting-in-aspnet-using.html [ ^ ]


当然。您可以从这里开始: http://support.microsoft.com/kb/976111 [ ^ ]。



参见:

http://msdn.microsoft .com / zh-CN / library / cc668201%28v = vs.100%29.aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/ms972974.aspx [ ^ ]。



-SA

Hi Guys,,

I have seen on many websites that for example if we are visiting a page named blog of that site than URL showing in browser is used to be like "www.sitename.com/blog" while if we want that we can also access the same page by typing "blog.sitename.com"....

How this functionality can be created and implemented in a web application made in Visual Studio on .net framework.


Can anybody help in this Regard.??


Regards,


:)

解决方案

There are several ways to rewrite URLs.

We can rewrite URLs from IIS settings with 'URLRewrite' module of IIS.

We can rewrite URL from global.asax file.

Referance as follows:
http://www.iis.net/learn/extensions/url-rewrite-module/iis-url-rewriting-and-aspnet-routing[^]
http://blog.dotnettechy.com/2011/09/url-rewriting-in-aspnet-using.html[^]


Sure. You can start from here: http://support.microsoft.com/kb/976111[^].

See also:
http://msdn.microsoft.com/en-us/library/cc668201%28v=vs.100%29.aspx[^],
http://msdn.microsoft.com/en-us/library/ms972974.aspx[^].

—SA


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

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