Can you name aspx files with the .html extension?

  • Thread starter Thread starter Rico Alexander
  • Start date Start date
R

Rico Alexander

Is there a way to get the webserver to process an html
file as a aspx file without naming it with the aspx
extension.
 
Hi Rico,

It depends on whether to have axxess to the configuration of your web
site.

The way IIS works, and, I imagine, other server systems too, is that the
extension of the file determines which processor (dll or exe) handles the
file. On my system, for instance, *.aspx is directed to aspnet_isapi.dll. You
would need to set the mapping for *.html to the same dll.

The downside of this is that <every> html file would be processed as an
aspx file. This would work ok but it would impose the overhead of the aspx
processor having to figure out that it's not always dealing with aspx code.

If you have the IIS documentation the topic is "Setting Application
Mappings". You can get it via the index using "extension" as the keyword.

Regards,
Fergus
 
Untested:

Edit the properties of the virtual directory containing the file (or the
entire website) on the server and change the application configuration.

Using IIS, go to the Home Directory tab, and click Configuration in the
Application section. Add a .html entry, with the same options as the .aspx
entry.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

"Maybe it's a game called 'Punish the User'"


: Is there a way to get the webserver to process an html
: file as a aspx file without naming it with the aspx
: extension.
 
Funny thing is that I did what you mentioned by changing the mappings
but it didn't seem to process the file as an aspx file. I wonder is
there an additional settting.
 
If that's the case, then it'll be the actual extension just dismissing the
..html file as a non executable webpage. There's nothing you can do about
that unfortunately.

May I ask why you wish to do this?

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

"Maybe it's a game called 'Punish the User'"


: Funny thing is that I did what you mentioned by changing the mappings
: but it didn't seem to process the file as an aspx file. I wonder is
: there an additional settting.
:
:
:
:
: Don't just participate in USENET...get rewarded for it!
 
Hi Rico,

You could have mentioned that you've tried remapping. Two peope have
wasted their time investigating for you and writing about something you
already know.

Regards,
Fergus
 
Hi again,

Second thoughts
..
moan, moan ... unless you mean you've tried it because I mentioned it.
In which case I apologise.

Sorry, I know of no other settings. Just to point out the obvious - you
have to do it on a per-application basis.

Regards,
Fergus
 
I'm converting a site to asp.net and don't want to have to rename all
the files and the links to match the aspx extension, but it's not that
big a deal. Would be nice though to hide the technology behind a site
by using the standard htm extensions which everyone is used to.
 
No, you're right, I should have been more descriptive of what steps I've
already taken. I'm kind of new to the forum and the setup. Thanks for
your help.
 
Hi Rico,

No worries, and welcome to the group. I'm just very tired tonight. I
shouldn't have snapped at you.

Regards,
Fergus
 
After changing the IIS mapping, you have to change the ASP.NET configuration
and tell it to process the HTML extension using the same handler as the ASPX
extension. This is done in the machine.config file, look a the file and you
should be able to figure out how to do it.
 
Hi again, TJ,

Can I have permission to borrow this joke for a while, please?

Regards,
Fergus
 
There are plenty other bug-free products out there :) You can be a Command
Prompt MVP, but feel free to reuse the joke. It's all about reusability here
!

cheers
 
Hi TJ,

Thanks. Re-use that's the spirit.

I like the sound of Command Prompt MVP, but I'm not <that> good.

Cheers,
Fergus
MVP [Windows Start button, Shutdown dialogue]
 
Fergus,
That is the most honourable I think, all dificult things in the Microsoft
software are still done by Command Prompt.
:-)
Cor
 
Back
Top