Login to Members Area

Choose the service you want to log in
24x7x365 Presence
Live Chat

Hosting Blog


The Apache "mod_rewrite": Best SEO Practices Tool

The Apache web server has a module called mod_rewrite which allows a URL in the client's browser to redirect to another URL, all by manipulation on the server side and without any change in the client's submitted URL.

mod_rewrite helps to create "clean URLs" and this module is commonly used by many CMS and blogging platforms like WordPress and Drupal.

To check if mod_rewrite has been enabled or not, just create an empty (xyz).php file anywhere on your web root and write the following line:

            <!--?php phpinfo(); ?-->

Open this file in any web browser using http://domain/xyz.php and check out apache2handler. mod_rewrite would appear there if it is enabled.

    Consider a website which takes input in the form http://abc.com/name.php?q=sachin. This looks ugly and is not search engine friendly. We would like to have something like http://abc.com/name/sachin. This would be nice and easy to remember. For this let us create a rule for mod_rewrite.
        RewriteEngine On
        RewriteRule ^name/(\w+)/?$ name.php?id=$1

The Rewrite engine is going to examine the incoming URL requests and convert the friendly URL into the URL understandable by the server!!

Sachin Monday 24 June 2013 - 8:31 pm | | Default
Used tags: , , , , ,

No comments

(optional field)
(optional field)

Comment moderation is enabled on this site. This means that your comment will not be visible until it has been approved by an editor.

Remember personal info?
Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.