09.06.05
Mapping .html file to .aspx
CNE is finally finished yesterday. I was loading and packing till the morning. Really really tired now, but at least I will not be this tired for another year! Hurray!
Back to topic here, my recent project requires using .htm or .html as extension, but they want the page to run with server side scripts. The reason they asked me to do that because the person is Apache+PHP guy. That is very common case with PHP programmer, but not really with ASP or .NET programmer. I did a googling, and found people asking the same question, but on answer. Finally, I found a solution from this URL:
http://www.dotnet247.com/247reference/msgs/16/82641.aspx
I tested it, and it works beautifully!! =) Here is what I did:
1. Setup IIS: open "Internet Serivices Manager", and click on the website you are hosted in IIS.
2. Right click and choose "Properties"
3. Go to "Home Directory" Tag, and click "Configuration…"
4. Click "Add"
5. Excutable for me is: C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll
6. Extension is ".htm" or ".html". I use ".html"
in this example
7. For security purpose, use Verbs "limited to": GET,HEAD,POST,DEBUG
Now you are done with IIS part. (Hint: just copy all settings from .aspx in
"Configuration.."
Then, you will need to add soemthing in your web.config, very important!!! Otherwise
it will not work:
8. Edit your web.config
9. within <system .web> add:
<httphandlers>
<add verb="*"
path="*.html"
type="System.Web.UI.PageHandlerFactory" />
</httphandlers>
Now we are set!! =) I really like this tips.