Archive

Archive for January 25, 2012

Enable mod_rewrite

January 25, 2012 Leave a comment

1. Change httpd configuration file

# vi httpd.conf  –/etc/httpd/conf/httpd.conf

Change ‘AllowOverride None’ to ‘AllowOverride All’

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
AllowOverride All

2. Uncomment rewrite module

LoadModule rewrite_module modules/mod_rewrite.so

3. Restart apache

# service httpd restart

4. Test the configuration
Create a .htaccess file and added following lines:

Options +FollowSymLinks
RewriteEngine On
RewriteRule (.*) http://www.inprose.com

5. Navigate to host website

If rewrite is working, the http://www.example.com would have no any parameters such as “index.php?id=idnum”.

Categories: apache