将URL .aspx更改为.html [英] Change The URL .aspx to .html

查看:103
本文介绍了将URL .aspx更改为.html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,在我的项目中有两个页面

1)default.html
2)default.aspx

当我运行项目时,该时间会加载default.aspx页面URL,例如.../.../default.aspx

好的,但是我想加载default.aspx页面,并且我想要类似.../.../default.html
的URL
因此,请帮助我....

I have a project, in my project have two pages

1)default.html
2)default.aspx

When i run my project that time load default.aspx page URL like .../.../default.aspx

ok but i want load default.aspx page & i want URL like .../.../default.html

so help me....

推荐答案

好吧,首先.aspx和.html页面的处理方式有所不同.因此您可以在任何给定时间加载"html"页面或"aspx"页面.但是,如果仅要将URL更改为html,但仍在内部处理aspx页面,则需要重写URL.以下是一些链接,这些链接告诉您如何在IIS上运行的ASP.NET中进行URL重写.

在ASP.NET中重写URL [使用ASP.NET进行URL重写 [
well, first of all .aspx and .html pages are way different in their processing. so you can either have an "html" page or an "aspx" page load at any given time. However, if you want just the URL to be changed to html but still process the aspx page internally, then you need to rewrite the URL. Following are some links that tell you how to do URL rewriting in ASP.NET running on IIS.

URL Rewrite in ASP.NET[^]

URL Rewriting with ASP.NET[^]

Hope this helps. Oh and also if you have IIS 7 then you can use something called URL Rewrite within IIS to setup rewriting rules that essentially just change the URL syntactically from anything to anything but still run the right server side code.
For e.g.
http://www.website.com/blah/params?param1=sdfs

将成为

http://www.website.com/blah/params/sdfs



希望这会有所帮助,并希望这就是您想要的...

干杯.



Hope this helps and hope this is what you wanted...

Cheers.


这篇关于将URL .aspx更改为.html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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