Configuring Alias module

This is guide for configuring your Saurus CMS Alias module.

NB! Current guide is for version 4.3.0 and later, for older versions please refer to InstallationGuide4.2.0.

  1. Install Apache URL Rewrite Engine module (mod_rewrite), see: http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html

  2. Open the Apache configuration file and add following lines to your virtual host configuration:

DirectoryIndex index.php index.html

Options +SymLinksIfOwnermatch

# rewrite rules for CMS alias's
Options +SymLinksIfOwnerMatch
RewriteEngine On

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,PT,QSA]

# RewriteLogLevel 0 will disable logging, we suggest set it to 2
# for debugging problems
# RewriteLogLevel 0

# set correct log file path here, we suggest set it only when debugging problems:
# RewriteLog /var/log/httpd/rewrite.log

NB! This block must be placed outside of <Directory> directives block.
 

NB!
In case you have any additional 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(/.*)



We suggest to keep the logging level at "0" on the production/live sites, because of remarkable space usge. Set RewriteLogLevel to "2" when developing the new site and debugging aliases.

 

Using subfolder


If your website is located in the subfolder, eg http://www.yoursite.com/mysite/ then the subfolder name must be added to the rewrite conditions:

DirectoryIndex index.php index.html

Options +SymLinksIfOwnermatch

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} ^/mysite
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !^/mysite/admin(/.*)
RewriteCond %{REQUEST_FILENAME} !^/mysite/classes(/.*)
RewriteCond %{REQUEST_FILENAME} !^/mysite/editor(/.*)
RewriteCond %{REQUEST_FILENAME} !^/mysite/extensions(/.*)
RewriteCond %{REQUEST_FILENAME} !^/mysite/js(/.*)
RewriteCond %{REQUEST_FILENAME} !^/mysite/public(/.*)
RewriteCond %{REQUEST_FILENAME} !^/mysite/px(/.*)
RewriteCond %{REQUEST_FILENAME} !^/mysite/shared(/.*)
RewriteCond %{REQUEST_FILENAME} !^/mysite/styles(/.*)
RewriteRule ^/(.*)$ /mysite/map.php?mod_rewrite=/mysite&cmd=$1 [L,PT,QSA]

# RewriteLogLevel 0 will disable logging, we suggest set it to 2
# for debugging problems
# RewriteLogLevel 0

# set correct log file path here, we suggest set it only when debugging problems:
# RewriteLog /var/log/httpd/rewrite.log