Configuring Alias module using .htaccess directives
NB! Using .htaccess file directives instead of per-server rules (in the Apache configuration file) is NOT recommended by us. While URL manipulations in per-server context are really fast and efficient, per-directory rewrites are slow and inefficient - use them at your own risk.
Install Apache URL Rewrite Engine module (mod_rewrite), see: http://httpd.apache.org/docs/mod/mod_rewrite.html.
Open the .htaccess file in your website folder and add following lines:
DirectoryIndex index.php index.html
########### Rewrite rules for Alias module in .htaccess file
# NB! using .htaccess file instead of per-server rules is NOT recommended,
# per-directory rewrites are slow and inefficient.
<Files *>
RewriteEngine On
Options +SymLinksIfOwnerMatch
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/admin(/.*)
RewriteCond %{REQUEST_URI} !^/classes(/.*)
RewriteCond %{REQUEST_URI} !^/editor(/.*)
RewriteCond %{REQUEST_URI} !^/extensions(/.*)
RewriteCond %{REQUEST_URI} !^/idcard(/.*)
RewriteCond %{REQUEST_URI} !^/js(/.*)
RewriteCond %{REQUEST_URI} !^/public(/.*)
RewriteCond %{REQUEST_URI} !^/px(/.*)
RewriteCond %{REQUEST_URI} !^/shared(/.*)
RewriteCond %{REQUEST_URI} !^/styles(/.*)
RewriteRule ^(.*)$ /map.php?mod_rewrite=/&cmd=$1 [L,QSA]
#Note: commands RewriteLogLevel and RewriteLog are not allowed in the .htaccess
</Files>
########### / Rewrite rules for Alias module Note: In case you have any extra directories or files under your website root directory, which are not part of the CMS installation, you should exclude them in the alias configuration.
Add following lines for each directory or file:
RewriteCond %{REQUEST_FILENAME} !^/notcmsdir Note: If your website is located in the sub-directory, eg http://www.yoursite.com/mysite/ then the sub-directory string must be added to the rewrite conditions:
DirectoryIndex index.php index.html
########### Rewrite rules for Alias module in .htaccess file
# NB! using .htaccess file instead of per-server rules is NOT recommended,
# per-directory rewrites are slow and inefficient.
<Files *>
RewriteEngine On
Options +SymLinksIfOwnerMatch
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/mysite/admin(/.*)
RewriteCond %{REQUEST_URI} !^/mysite/classes(/.*)
RewriteCond %{REQUEST_URI} !^/mysite/editor(/.*)
RewriteCond %{REQUEST_URI} !^/mysite/extensions(/.*)
RewriteCond %{REQUEST_URI} !^/mysite/js(/.*)
RewriteCond %{REQUEST_URI} !^/mysite/public(/.*)
RewriteCond %{REQUEST_URI} !^/mysite/px(/.*)
RewriteCond %{REQUEST_URI} !^/mysite/px_custom(/.*)
RewriteCond %{REQUEST_URI} !^/mysite/shared(/.*)
RewriteCond %{REQUEST_URI} !^/mysite/styles(/.*)
RewriteCond %{REQUEST_URI} !^/mysite/map
RewriteRule ^(.*)$ /mysite/map.php?mod_rewrite=/mysite/&cmd=$1 [L,QSA]
#Note: commands RewriteLogLevel and RewriteLog are not allowed in the .htaccess
</Files>
########### / Rewrite rules for Alias module
