2010-01-21, 17:11:54
(This post was last modified: 2010-01-21, 17:15:57 by kuba.sanitrak.)
Thank you. I've added it to a base htaccess file I usually use.
Code:
# Set up for rewrite rules
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
# Force www on domain name
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
# Exclude admin directory from rewrite rules
RewriteRule ^(admin) - [L]
# Rewrite for Pretty URLs support
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9-]+)/?$ index.php?id=$1 [L,QSA]
# Disregard seemingly malicious scripts
RewriteCond %{QUERY_STRING} (base(dir)?|(classes|lib)_dir|error|inhalt|page|path)=|root_dir|request|session|http:// [NC]
RewriteRule .* - [F,L]
# Try to compress JS and CSS files
<IfModule mod_deflate.c>
<FilesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>