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:

So that it reads:

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]
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Accessing Website Stats without logging into cPanel

Accessing AWStats Outside of cPanel Accessing AWStats from outside the control panel is easy....

How do I access my clients' cPanel account?

Resellers can access their clients' control panel to make changes simply by substituting the...

I've forgotten my cPanel login. What do I do?

If you cannot remember your server login information, please submit a ticket with our staff and...

My Website Statistics have not Updated

Typically your web sites statistics are updated overnight. Occasionally, if the server has been...

How to change the primary IP addres of a WHM/cPanel server

This is for Centos Based SystemsSteps in WHM: Log into WHM and go to Basic cPanel &...