SharpLife.NET
A sharp way to know more // Mahdi Taghizadeh's Daily Web Keystrokes.
Navigation for SharpLife.NET - URL Rewriting Issues in ASP.NET 1.x
Content
Sidebar
Footer
February 28, 2006
@ 01:43 PM
Comments [3]
URL Rewriting Issues in ASP.NET 1.x
It's more than 1 year that I'm using URL rewriting in my web application projects to make pages adresses more friendly. Before ASP.NET 2.0 release and its URL Mapping feature, web developers had to write their own Http Handlers to perform a complete URL rewriting solution.
Scott Mitchell
had written a good HttpHandler for URL rewriting in ASP.NET 1.x which published on MSDN as a technical
article
.
For its time, this tool was good enough because it let developers use regular expression to rewrite URLs. One major problem that developers may face while using this tool is "Not Available Folders" rewrite rules. Imagine you want to rewrite a path like this: ~/News/2005/ to ~/News/Default.aspx?Year=2005. It is a good idea to let visitors hack your URLs. But if you don't have a real 2005 folder and a default.aspx file inside it, IIS will return a 404 error page. In such cases we have two solutions: 1- Make a dummy folder for such URLs. 2- Map all incoming requests to ASP.NET engine. It's clear that first solution is not suitable because you should make a new folder on the fly for a record that is added in 2006! And also the second is not a good idea because we should handle all extensions manually. As Scott said on his blog (and on MSDN article), .Text (and Community Server I guess) use a solution similar to our second option but unfortunately I didn't check them so far.
It's my story these days!! If you faced this problem too and have solutions please discuss on it in the comments. (Specially, if you have worked on .Text or CS source codes you may know more about their solutions. So as
Soheil
says on
iDevCenter
"Share Your Knowledge" !!!)
UPDATE [3/2/2006]
: There is another solution for those who have access to web server.
IISMods.com
offers an open-source free ISAPI filter for IIS that let you perform URL Rewriting at the web server level. But this solution is not suitable for shared server hosting packages. So I won't use it!
Categories:
ASP.NET
|
Web Development
Related posts:
How to use ASP.NET Membership in a Console Application
Some ASP.NET Articles
BlogEngine.NET 1.2 Released
Current ASP.NET URL Rewriting Solutions VS. IIS 7.0 Solution
Weather in ASP.NET
asp.netPRO Magazine Free PDF Edition
« AjaxLessons.com
|
Home
|
Anti XSS Library for .NET »
Tuesday, February 28, 2006 2:21:28 PM (Iran Standard Time, UTC+03:30)
Dear Mehdi, I have used .Text solution myself in many web projects and it worked! I recommend you to focus on it. I have not any look on their recent CS, so you may find a better solution in CS 2.0.
Sasan
Tuesday, February 28, 2006 5:12:02 PM (Iran Standard Time, UTC+03:30)
Look at this pack. I think that it's useful:
http://www.urlrewriting.net/en/Download.aspx
Shortly, In CS 2.0, they have 2 ways to handle this problem:
1- TinyURL Module: Which is used to make the Urls shorter.
2- Url Module: Which does Url reqwriting and contains these steps:
A- In some cases uses a Auto Folder Creation to generate those dummmy folders.
B- A HTTP Module to handle Url Rewriting as an engine.
Keyvan Nayyeri
Friday, March 03, 2006 6:14:33 AM (Iran Standard Time, UTC+03:30)
You may use another Virtual Directory inside your main ones so that you handle everything using ASP.NET. As far as I know, the only way you can handle folders virtually is handling *.* with ASP.NET, so by creating a seprate Virtual Directory, it will be effortless handling the matters.
Ali Parvaresh
Comments are closed.
Special
Tabassom's Photo Gallery
Contact
Email me!
RSS/Subscribe
Subscribe in a reader
Archives
All dates
All Posts
Microblog/MicroSharpLife!
Search
Latest Posts
Laptopical.com, The Laptops Weblog!
Find Your Web site SQL Injection Vulnerabilities Using Scrawlr
How to use ASP.NET Membership in a Console Application
Follow my tiny posts on twitter too!
Joint Song by Arian Music Band and Chris De Burgh
Download .netTiers Documentation
Jaiku Invitations
reCAPTCHA: Free CAPTCHA Solution For Your Website
Categories
.NET General (11)
AJAX (10)
ASP.NET (18)
C# (3)
Celebrities (1)
Community Server Persian (1)
dasBlog (1)
Download (19)
General (6)
i18n (4)
Iran (5)
Mathematics (1)
Microsoft (8)
Music (1)
Notebook (1)
Other (6)
Personal (11)
Politics (1)
Review (1)
Security (6)
SharpLife.NET (5)
Smart Phone (2)
Software (6)
Sports (3)
SQL Server (1)
Tabassom (2)
Tools (5)
Training (1)
Web (8)
Web 2.0 (7)
Web Development (9)
Web Services (3)
Archives
August, 2008 (1)
July, 2008 (2)
June, 2008 (1)
November, 2007 (2)
October, 2007 (4)
September, 2007 (14)
August, 2007 (5)
May, 2006 (4)
April, 2006 (6)
March, 2006 (5)
February, 2006 (20)
January, 2006 (2)
BlogRoll
Alireza Esmaeili
Behnam Youssefi
Farid Arzpeyma
Keyvan Nayyeri
Meysam Jafarinezhad
Nima Shayafar
Pedram Pourhossein
Reza Hashemi
Sassan Yeganegi
Scott Hanselman
Shima Dehbashi
Tabassom Taghizadeh
See my little daughter photos.
Categories
.NET General
AJAX
ASP.NET
C#
Celebrities
Community Server Persian
dasBlog
Download
General
i18n
Iran
Mathematics
Microsoft
Music
Notebook
Other
Personal
Politics
Review
Security
SharpLife.NET
Smart Phone
Software
Sports
SQL Server
Tabassom
Tools
Training
Web
Web 2.0
Web Development
Web Services
BlogRush