homepage url as example.com/ rather than example.com/index.html
I have a site I want to deploy and as part of th开发者_Go百科e finishing touch, I'd like to have the url in the browser show www.example.com/ instead of www.example.com/index.html
How is this done?
You could do this by "redirecting" requests of one URL (www.example.com) to another URL (www.example.com/index.html). This is done server-side by sending a HTTP 301 (or 302) to the user's browser.
Normally you use so called "rewrite" tools that intercept a request on your webserver and by executing rules that are made out of Regular Expressions. The rules decide whether/how to redirect.
Tools
You could install the official Rewrite module for IIS, if you are using IIS 7 or above. If you are using IIS 6, you could use the Open Source UrlRewriter.NET.
Personally, I have very good experiences with both of them, even together inside one single project.
If all that is needed is the default redirect for the website, consider using httpRedirect feature in IIS7\IIS6.
精彩评论