: How do you hide file extension in URL? I would like to drop the .aspx extension from my webpages. One reason is that I'm not sure I will stick to ASP.NET WebForms technology. How do you
I would like to drop the .aspx extension from my webpages. One reason is that I'm not sure I will stick to ASP.NET WebForms technology. How do you do it?
More posts by @Murray155
1 Comments
Sorted by latest first Latest Oldest Best
Inbound URLs are easy - simply grab a tool like URL Rewriter, create a rule to map incoming requests that do not have .aspx to include the aspx in the processing of the request and you are done.
The problem, however, is outbound URLs. Your site/app generates URLs everywhere and every one of those contains a link to something.aspx and which is the very format you are trying to get away from. You can either rewrite your entire app to not include the .aspx or you can put something in the pipeline to filter those out of the pages before they are sent to the user.
Again, URL Rewriter can do this, but it takes a while to get the rules right. Another fairly common approach is to simply write your own httpModule and do the processing yourself.
Bear in mind that any utility that rewrites outbound page content may cause problems with server-side caching.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.