There are many simple and effective tweaks that can be applied to a web site right down to underlying application and database. A well coded clear and simple architecture for a web application allows for specific things that make the URL more readable for search engines.
For example if you had an online store and had a URL http://www.where.com/cgi/get_product?product_id=6
for an individual product and an equally complicated URL for store category listings, same problems persist through to content management software.
The solution; transform those nasty URI's into something more pleasant to both the human eye and search engines many eyes. Under the apache web server the process is oh-so quick easy and elegant, as true with most linux server applications. In Apache there are several server configuration directives that allow you to take a simple URL that traslates and expand it to the complex ugly querystrings. So as in our shop example above, lets say we want to display that URI as http://where.com/shop/products/6
, of course if would not take much more effort or time to take this a step further by using a descriptive test tag to describe the product in the URI, something along the lines of: /shop/products/samsung_lcd_SD500. In these scenario an apache rewrite directive would be used. You will need to switch on Rewrite Engine in Apache before starting, this is simply done by adding this directive to your apache httpd.conf: RewriteEngine On
Then we can use our Rewrite directive.
RewriteRule ^/shop/products/([0-9]+)/ /cgi/get_product?product_id=6
As you may notice you can use regular expressions in the rewrite rule, this obviously gives a tremendous amount of power and control of how you translate your URL, keywords can easily be inserted and translated to URL using regular expressions, in this case here we just tell it the URI and that a number must be present to identiy product.
In a case like a content managment system the process is also quite straightforward. If theres only going to be about 10-20 pages on a website it is feasible and practical to use a Redirect directive.
Redirect /content?go=GetPage&do=display&page_id=1 http://where.com/index.html
This approach is more practical as you can see, but it does not scale to well as a solution, of course the above could be achieved with a rewrite with little though. The full redirect URL is unfortunately needed, a URI alone will not be sufficient.
serurk rewrite & redirects
Diarmuid Ryan is the Managing Director of Blue Star Technologies specialising in web site database-driven applications.
Blue Star Web Design
Article Source: http://EzineArticles.com/?expert=Diarmuid_Ryan