Online Chat
 Call Us: 
1-877-744-1221
Browse Submit a Ticket
 
Advanced Search
Tools
Rss Categories

Configuring mod_rewrite for Linux/UNIX with Apache

Author: Edward Hardin Reference Number: AA-00478 Views: 17057 Last Updated: 08/16/2012 12:05 PM 0 Rating/ Voters
  1. Before you begin this, please make sure you make a backup copy of the original file in case you make a mistake, this way you can always go back to the original configuration - always backup before you begin doing something like this.
  2. Find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines). On some Linux distributions (e.g. Ubuntu) you may need to use apache2.conf instead.
    If you can't find the httpd.conf file, try following locations:
    /etc/httpd/httpd.conf
    /usr/local/apache/conf/httpd.conf
    /usr/local/apache2/conf/httpd.conf
    /usr/local/apache/httpd.conf
    /usr/local/apache2/httpd.conf
    /usr/local/httpd/conf/httpd.conf
    /usr/local/etc/apache/conf/httpd.conf
    /usr/local/etc/apache2/conf/httpd.conf
    /usr/local/etc/httpd/conf/httpd.conf
    /usr/apache2/conf/httpd.conf
    /usr/apache/conf/httpd.conf
    /usr/local/apps/apache2/conf/httpd.conf
    /usr/local/apps/apache/conf/httpd.conf
    /etc/apache/conf/httpd.conf
    /etc/apache2/conf/httpd.conf
    /etc/httpd/conf/httpd.conf
    /etc/http/conf/httpd.conf
    /etc/apache2/httpd.conf
    /opt/apache/conf/httpd.conf
    /opt/apache2/conf/httpd.conf
    /var/www/conf/httpd.conf
  3. Inside the config file find and uncomment the line LoadModule rewrite_module modules/mod_rewrite.c (remove the pound '#' sign from in front of the line - the # sign is for comments, by removing the # sign, you are uncommenting the line)
  4. Find <Directory /> directive and make sure that Options All and AllowOverride All options are enabled:
    <Directory />
    Options All
    AllowOverride All
    </Directory>
  5. These options can be overridden by other <Directory> directives that are applied for sub-directories. Make sure that Options All and AllowOverride All options are not disabled for directory where KnowledgeBase Manager Pro is uploaded.
  6. After you have made the changes and saved them, restart your httpd (apache) server for the changes to take affect. The easiest way to do this is to go to the shell command and type: /etc/init.d/httpd restart
  7. Go to Styling and Front-end Settings to switch URL Rewriting ON and save the new settings.

  8. Open a KMP front-end page in your browser to check if URL Rewrite works correctly now.
  9. Very rarely you may need to specify a RewriteBase parameter as well. See this guide for details.

Shared Hosting

Usually you do not have access to the main Apache configuration file if you're using a shared hosting. In this case you should skip all steps from this guide that involve editing of the httpd.conf (or Apache2.conf).

Inquire your hosting company or check their documentation about availability of the mod_rewrite module for Apache. If it is not enabled, ask them to enable it.

If that won't help, you may need to specify RewriteBase parameter as well.