问题
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