In asp.net, how can we disable the page extension in the browser. can you help me. Thank you.
-
this is same post as http://stackoverflow.com/questions/4481632/remove-html-or-aspx-extension – Bhargav Mistri Nov 15 '11 at 11:20
2 Answers
its URLrewritting there are a lot of resource on thenet this one is good URL Rewriting with ASP.NET and this one URL Rewriting in ASP.NET

- 4,633
- 17
- 22
-
can we do in asp.net, if yes can you tell me that process, please. – Surya sasidhar Nov 15 '11 at 11:13
You can easily do this by creating a folder with name of your choice and create your asp.net page inside the folder and set it is a default page for that folder, IIS usually considers file with file name as index, default, home by default.
Example - : If you want your url to be
yoursitename.com/login
instead of yoursitename.com/login.aspx
, just create a folder with the name login in your site and in the root of the login folder add your asp.net page with any name and make it the default page for that folder and disable directory browsing for that folder
You can alternatively use URL Rewriting techniques to acheive this

- 4,237
- 7
- 49
- 74
-
This would be a painful and messy way to do this, imo. Rewriting/Routing are much better options. – Andrew Barber Nov 17 '11 at 04:20
-
@AndrewBarber I agree, but i observed a few websites doing this, may be it is automated for them – Vamsi Nov 17 '11 at 04:59