How to make mod_rewrite module works on statically compiled Apache modules

If you statically install mod_rewrite module (on Apache 2 will install it by default) you do not need to load the module manually by using ‘LoadModule’ option in httpd.conf file. If you do this, you will get error messages telling you that the module is built-in and can not be loaded.

To check your mod_rewrite module is already installed, run this command:

fuad@radsvr01:~$ /usr/local/apache/bin/httpd -l | grep rewrite

If you see the output is like above, it means the mod_rewrite module is already installed and ready to use.

What you need to do is telling the Apache to read access file on the directory as defined before (your root web directory). It is set on ‘AllowOverride’ directive in the httpd.conf file.

Let’s say your root web directory is located at /home/yours/www. In your httpd.conf file should be set like this:

Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all

Do not set the ‘AllowOverride’ directive to ‘None’. Otherwise the mod_rewrite module will not work.

To test it works or not, the link below is great for you: