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

Specifing RewriteBase parameter

Author: Edward Hardin Reference Number: AA-00465 Views: 15463 Last Updated: 01/28/2010 04:58 PM 0 Rating/ Voters

Hardly ever you may need to specify a RewriteBase parameter in the .htaccess files. This solution works for UNIX/Linux servers with Apache only. Use it only if other steps do not help in configuration of mod_rewrite.

RewriteBase is the path from the webroot directory to current .htaccess file. Its value is different for each .htaccess file since paths are different too. For example, KMP is installed to the /www/kb/ directory and /www is your webroot. Then you need to specify RewriteBase in the /kb/.htaccess file after the RewriteEngine parameter like this:

/kb/.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /kb/
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

There are three more .htaccess files to go:

/kb/admin/.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /kb/admin/
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>


/kb/hosts/hosted/.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /kb/hosts/hosted/
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>


 

/kb/hosts/preview/.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /kb/hosts/preview/
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>