VirtualHost
Here's an Apache virtual host spec that works with released controller:
<VirtualHost my.domain.com:80>
ServerName my.domain.com
ServerRoot /path/to/server/root/
DocumentRoot /path/to/server/root/my.domain.com/document_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 10.0.0.6/255.255.255.248
</Location>
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
</VirtualHost>
.htaccess
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.
Labels:
None