Skip to content

HTTP Status Messages

General

In URL rewriting the browser sends URL to server and server reconstructs it for the script. In redirection the new URL will be sent back to browser and the browser will have to request again. The search engines will update their databases. 301 redirection is permanent whereas 302 redirection is temporary.

URL rewriting allows you to completely separate the URL from the resource. Now one URL means one way to find a resource. For example, www.abc.com/aboutus may point to www.abc.com/page.php=1 and www.abc.com/help may point to www.abc.com/page.php=5.

URL rewriting module is

RewriteEngine On
RewriteBase /base
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} !^id=0$
RewriteRule ^products/(.+)$ ^products.php?id=$1$ [L]