How can I enable Mod_Rewrite?

Recommended for Advanced Users Only

What is mod_rewrite?

This module provides a rule-based rewriting engine to rewrite requested URLs on the fly. For instance, you can re-write a complicated URL such as:

http://www.yourdomain.com/index.php?section=services&product=hosting

So that it reads:

http://www.yourdomain.com/services/hosting

This is highly useful if you are creating a PHP driven web site, for instance, but you wish to have nice search engine and human friendly URLs appearing in the address bar.

How can I enable mod_rewrite?

1. Create a file called .htaccess in the folder you wish the rewrite rules to apply.
2. The first line in the file should be RewriteEngine On
3. After this, you can put all the rules you require. You can visit this useful web site for more information on mod_rewrite, and a handy cheat sheet with common rules.

If you have any further problems please don’t hesitate to contact us.

Example mod_rewrite file:

RewriteEngine on
RewriteRule ^([^/.]+).htm$ index.php?page=$1 [L]

l1@squarebrothers.com'About Support
We are working as a Server administrator at Squarebrothers Info tech Pvt Ltd. We are First ICANN accredited Domain Registrar in South India. We are partner with Cpanel NOC, Microsoft SPLA, APNIC member and Microsoft GOLD partner.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

You must be logged in to post a comment.