hide extensions of the pages with web.config

久未见 提交于 2019-12-24 21:18:33

问题


How do I hide the extensions of the pages?

Example ... access as is the normal asp page, but I would like to access the page or pages as ... without. asp

In my case I want it in web.config

Thanks!


回答1:


You can use IIS URL Rewrite to do that, you can download it from: http://www.iis.net/download/URLRewrite

After that you can easily write rules to rewrite the path to match anything you want, including removing file extensions, etc.




回答2:


If hiding dynamic page you should have in IIS > Handler Mappings a line with ExtensionlessUrlHandler-ISAPI-4.0_64bit

If static page, IIS has a bug for static files and you need to apply a hotfix (if not applied yet) http://support.microsoft.com/kb/2646735

after that you need to add to your Web.Config system.webServer section




回答3:


you can modify the web.config file so the url only shows the directory

Hide webpage name



来源:https://stackoverflow.com/questions/4124342/hide-extensions-of-the-pages-with-web-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!