Why use Url Re-Writing and Redirection ?
What is web redirection and why would you want to use it?
Experts in web usability recommend that:
- URLs should be short and memorable
- URLs should be are easy-to-type
- URLs should help visualize the site structure
- URLs should be are "hackable"
- URLs should be consistent and persistent
There are several reasons you may want to redirect URLs on your website so that
you can satisfy these goals:
Create friendly URLs with URL Re-Writing
Often the URLs that our dynamic database-driven websites generate are not the friendliest
or most memorable. By re-writing URLs the long, ugly, querystring-type URLs can
be shortened to much friendlier and more memorable ones.
|
Old URL
|
New URL
|
|
/employeeInfo.aspx?employeeID=1
|
/people/Steven-Buchanan
/people/Steven-Buchanan.aspx
|
|
/productList.aspx?categoryID=1
|
/products/beverages
/products/beverages.aspx
|
|
/productInfo.aspx?categoryID=1&productID=2
|
/products/beverages/Chai
/products/beverages/Chai.aspx
|
Use friendly URLs to improve search rankings
Many search engines such as Google take the URL into account when indexing a site.
Some ignore the query-string altogether and may not even index your pages. Having
the relevant keywords and product names in your URL can help to dramatically increase
your search engine rankings and site traffic.
Create 'Hackable' URLs
QueryString URLs make sense to programmers and web-developers who understand their
purpose and how the site and database are likely to work behind the scenes but they
are less intuitive to end-users who find a hierarchy of folders easier to visualise.
By making your site appear to contain a folder-like hierarchy, it enables users
to more easily manipulate the URL to find the information they require.
|
Old URL
|
New URL
|
|
/OrdersByYear.aspx?year=1997
|
/orders/1997
|
|
/OrdersByMonth.aspx?year=1997&month=11
|
/orders/1997/11
|
|
/OrdersByDay.aspx?year=1997&month=11&day=22
|
/orders/1997/11/22
|
Use short email-friendly URLs
Long URLs can run into problems when they are automatically wrapped at 78 characters
in email clients, breaking the URLs.
Rather than having instructions to copy and paste the URL fragments into one URL
in the browser address bar (and having to rely on the users following them) it is
much better to have shorter URLs that can be kept to one line.
With the increase in 'phishing' and spoofing, shorter URLs are also friendlier to
users as they are quicker to visually scan and users will be more confident in clicking
them without complex QueryString parameters.
Use URL redirection to track offsite clicks
It's impossible to know what off-site links your visitors are following if you provide
direct URLs in your site. By using a simple redirect though you can have the links
appear in your IIS logs for later analysis.
|
Old URL
|
New URL
|
|
http://www.affiliate.com/
|
/affiliate.aspx
|
|
http://www.componentsource.com/Browse.asp?SC=EINTE
|
/reseller.aspx
|
Keep consistent URLs during site reorganisation
You may have reorganised your website due to a redesign or growth and changed the
name and/or location of some pages. Rather than lose traffic from people who have
either bookmarked the old pages or from existing links and search-engine results
you can instead redirect the requests to the new pages to avoid the 'linkrot' that
can equal lost traffic.
|
Old URL
|
New URL
|
|
http://www.mysite.com/buynow.aspx
|
http://shop.mysite.com/
|
|
http://www.mysite.com/support.aspx
|
http://support.mysite.com/
|
|
http://www.mysite.com/getintouch.aspx
|
http://www.mysite.com/contacts.aspx
|
|