Results 1 to 5 of 5
  1. #1

  2. #2

    Mod_Rewrite How-To Guide

    Note: Guide Assumptions

    This guide assumes that you're using the following:

    • Apache 1.3 or later
    • PHP
    • Apache's Mod_Rewrite Module enabled on your server

  3. #3

    Mod_Rewrite How-To Guide

    Important: Make sure Mod_Rewrite is Installed and Enabled

    On some web hosts Mod_Rewrite is not enabled by default.

    To check if mod_rewrite is installed:

    Note: In most PHP configurations you can detect if Mod_Rewrite is installed with the method below. If, however, you're using CGI / SuPHP you will have to check the Apache httpd.conf file manually.

  4. #4

    Mod_Rewrite How-To Guide

    Now, navigate to this page in your browser and look under the Loaded Modules section. This can be located using Ctrl+F in your browser. In this list try and locate mod_rewrite. If it is listed here, you're good to go. If not, you'll need to enable it.

    To enable it, you need to locate Apache's configuration file. This file is called httpd.conf.

    Note: If you're on a shared host and don't have access to the httpd.conf file for the Apache Server you will need to contact your web host and request they enable the mod_rewrite module.

    Once you've located httpd.conf open it and search for the following line. Ensure it is not commented out by removing a # symbol if it is in front of the line:

    Enabled: LoadModule rewrite_module modules/

    Disabled: #LoadModule rewrite_module modules/

    Once you've enabled the line you will need to restart your Apache server in order for it to take effect.

  5. #5

    Mod_Rewrite How-To Guide

    Understanding what Mod Rewrite does

    Mod_Rewrite is the process of converting from URLs filled with variables to clean URLs:

    URL Before Re-write:

    URL After Re-write:


    • Search engine friendly
    • Easy for users to read
    • Protects details of how your web application is implemented

    The Server (aka Apache) doesn't understand To that it will understand it as folders and sub-directories.

    Essentially what you are doing is making it so all the links the user sees are the nice, clean ones. The only time the long index.php?p=about...etc. links appear are internally to apache - never seen by the user.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts