RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https:
# Redirect at HTTPS without WWW
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https:
# Prevent to load sensible data
<FilesMatch
"\.(dat|tpl|inc)$"
>
order deny,allow
deny from all
</FilesMatch>
# Sitemap shortcut
RewriteRule ^sitemap\.xml$ index.php?r=sitemap [L]
# Admin area
and
message are special scripts
RewriteRule ^admin/([a-z0-9]+) admin.php?m=
$1
[QSA,NC,NE,L]
RewriteRule ^(admin|login|message)(/|\?|$)
$1
.php [QSA,NC,NE,L]
# System category has priority over /system folder
RewriteRule ^system/?$ index.php?rwr=system [QSA,NC,NE,L]
# All the rest goes through standard rewrite gateway
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]+) index.php?rwr=
$1
[QSA,NC,NE,L]
<IfModule mod_headers.c>
Header always append X-Frame-Options SAMEORIGIN
</IfModule>