Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History


Here's an Apache virtual host spec that works with released controller:

	ServerRoot     /path/to/server/root/
	DocumentRoot   /path/to/server/root/

	RewriteEngine off

	<Location / >
		RewriteEngine on
		RewriteCond %{REQUEST_FILENAME} !-f
		RewriteCond %{REQUEST_FILENAME} !-d
		RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php
		Options FollowSymLinks Includes ExecCGI MultiViews
		Order Deny,Allow
		Deny from all
		Allow from

LogLevel        debug
ErrorLog        /var/logs/apache2/my.domain.com_error.log
TransferLog     /var/logs/apache2/my.domain.com_access.log
CustomLog       /var/logs/apache2/my.domain.com_custom.log   combined

RewriteLogLevel 9
RewriteLog      /var/logs/apache2/my.domain.com_modrewrite.log



Basic funnelling

This rules directs all requests to index.php, except some file types (.js, .ico, .txt, .gif, .jpg, .png, and .css):

RewriteEngine on
RewriteBase /
RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ index.php

Handling file & dir exceptions:

These rules (used right before the RewriteRule above) excludes real files and directories from the rewriting and lets them pass through untouched:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

You can also simply allow a specified group of files to pass through the rewrite by using this line:

RewriteRule  ^(foo|bar).*  - [L]

In this case, files foo.* and bar.* will be accessed normally.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.