Syncrat - An article website that focuses on Music, Dating & Relationships and Business & Money. Learn about music, improve your dating or learn to make your money go further.

Rewriting URLs with mod_rewrite (Apache URL rewrite tool)

``The great thing about mod_rewrite is it gives you all the configurability and flexibility of Sendmail. The downside to mod_rewrite is that it gives you all the configurability and flexibility of Sendmail.''
-- Brian Behlendorf
Apache Group
`` Despite the tons of examples and docs, mod_rewrite is voodoo. Damned cool voodoo, but still voodoo. ''
-- Brian Moore
bem@news.cmc.net

The Apache module mod_rewrite is a killer one, i.e. it is a really sophisticated module which provides a powerful way to do URL manipulations. With it you can do nearly all types of URL manipulations you ever dreamed about. The price you have to pay is to accept complexity, because mod_rewrite's major drawback is that it is not easy to understand and use for the beginner. And even Apache experts sometimes discover new aspects where mod_rewrite can help.

In other words: With mod_rewrite you either shoot yourself in the foot the first time and never use it again or love it for the rest of your life because of its power.

Why use mod_rewrite

Hide original url and paths to scripts
Although obscurity is one of the lowest forms of security, you can use mod_rewrite to stop visitors seeing the full paths of your scripts. This includes the file extensions.
Tidy up URLs
Mod_rewrite allows you to take a hard to remember URL and tidy it up. The resulting URL can be something that the user can type out, rather that a really long mess.
Search Engine Optimisation
Search Engine will crawl your site with their bot scripts. Research shows that most Search Engines would prefer static pages rather than a Dynamic pages. 

For some examples on using mod_rewrite, see the Apache 1.3 URL Rewriting Guide

Tags: , , , ,

Related Items:

Comments / Replies

Add Comment / Reply

The address of your website or social networking page. Make sure that you include http://
You can not use HTML in this field. If you wish to add a URL, write the full URL including http://
 

This website follows the ideas of the No Nofollow, I Follow, DoFollow, No-NoFollow movement. Leave a helpful comment and you will get a link without NoFollow (U Comment, I Follow).

Web Hosting

If you are looking for web hosting then I would recommend my current web host. They have been good to me, suiting both beginners and advanced users.

Advertising

Using a transparent and trusted advertising network always helps to generate more revenue on a website. One of the networks I use achieves this more than the others.

Donations

If you would like to help pay the web hosting bill for this site, you can donate through my host

Your Ad Here

Web Hosting

If you are looking for web hosting then I would recommend my current web host. They have been good to me, suiting both beginners and advanced users.

Advertising

Using a transparent and trusted advertising network always helps to generate more revenue on a website. One of the networks I use achieves this more than the others.

Donations

If you would like to help pay the web hosting bill for this site, you can donate through my host