Friday, April 23, 2010

URL Rewriting

URL rewriting

URL rewriting is the process of intercepting an incoming Web request and redirecting the request to a different resource. When performing URL rewriting, typically the URL being requested is checked and, based on its value, the request is redirected to a different URL. For example, in the case where a website restructuring caused all of the Web pages in the /people/ directory to be moved to a /info/employees/ directory, you would want to use URL rewriting to check if a Web request was intended for a file in the /people/ directory. If the request was for a file in the /people/ directory, you'd want to automatically redirect the request to the same file, but in the /info/employees/ directory instead.

URL rewriting - Few Excellent Resources

1. URL Rewriting in ASP.NET

Introduction, Common Uses of URL Rewriting, What Happens When a Request Reaches IIS, Implementing URL Rewriting, Building a URL Rewriting Engine, Performing Simple URL Rewriting with the URL Rewriting Engine, Creating Truly "Hackable" URLs etc.

2. URL Rewriting

An Introduction to Rewriting, Basic Rewriting, Basic Redirects, Forcing New Requests, Using Regular Expressions, Multiple Redirects, Adding Guessable URLs.

3. URL Rewriting Examples

5 useful url rewriting examples using .htaccess

>Rewriting product.php?id=12 to product-12.html
>Rewriting product.php?id=12 to product/ipod-nano/12.html
>Redirecting non www URL to www URL
>Rewriting yoursite.com/user.php?username=xyz to yoursite.com/xyz
>Redirecting the domain to a new subfolder of inside public_html

4. URL Rewriting for Beginners

A beginner's guide to URL rewriting, with plenty of examples.

What is "URL Rewriting"?, Platforms and Tools, Basic URL Rewriting, Exceptions and Special Cases, Working With Multiple Rules.

5. 10 URL Rewriting Tips and Tricks

This post describes some of the tips and tricks that one may find useful when solving URL-based problems for their web server or web site. Each tip/trick has a description of a problem and then an example of how it can be solved with IIS 7 URL Rewrite Module.

6. URL Rewriting to Prevent Duplicate URLs


7. URL Rewriting Guide

This document supplements the mod_rewrite reference documentation. It describes how one can use Apache's mod_rewrite to solve typical URL-based problems with which webmasters are commonony confronted.

8. A Complete URL Rewriting Solution for ASP.NET 2.0

This article describes a complete solution for URL rewriting in ASP.NET 2.0. The solution uses regular expressions to specify rewriting rules and resolves possible difficulties with postback from pages accessed via virtual URLs.

9. URL Rewriting Simplified - An academic view on URL Rewriting

What is URL Rewriting? - An explanation of the process called URL Rewriting. Why URL Rewriting is used?, How can I implement URL Rewriting?

10. URL Rewriting, What is URL Rewriting?, Why URL Rewriting?, How?

11. How to Succeed With URLs