DirectorySlash Off DirectoryIndex index.php AddDefaultCharset UTF-8 Options -Indexes RewriteEngine On RewriteBase / ErrorDocument 403 /index.php?error_code=403 ErrorDocument 404 /index.php?error_code=404 ErrorDocument 500 /index.php?error_code=500 # 301 REDIRECT WWW.DOMAIN.COM TO DOMAIN.COM: #RewriteCond %{HTTP_HOST} ^www\.(.*)$ #RewriteRule ^(.*)$ http://%1/$1 [L,R=301] # 301 REDIRECT DOMAIN.COM TO WWW.DOMAIN.COM: #RewriteCond %{HTTP_HOST} ^([^www].*)$ #RewriteRule ^(.*)$ http://www.%1/$1 [L,R=301] RewriteRule \/sys_tmp\/|^ucontent\/.*\.txt|^system\/|\/stats_tmp\/|\/_rezerv_images\/|\/cache\/|\.ini$|(user)?macros\.xml$|\.lock$|\.db$|\/parsing_log\.txt$|\/antivirus_md5\.txt$|\.cfg$|_client\.zip$|\/browscap_cache\.php$|\/templates\/.*\.(html|tpl|php|txt)$|public\/view\/stats\/cloaking.js$ - [R=404] RewriteRule ^templates/(.*) public/view/templates/$1 [L] RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php [L,QSA]