RewriteEngine On
RewriteBase /
Options +FollowSymlinks
Options -Indexes

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=permanent]

ErrorDocument 404 http://www.{PAGE}/

RewriteRule ^admin/strona_glowna$ admin/index.php [L]
RewriteRule ^szablon,([^-]+)$ index.php?template=$1 [L]
RewriteRule ^lang,([^-]+)$ index.php?rw=change_language&id=$1 [L]

RewriteRule ^s,([0-9]+),([^,]+)$ index.php?rw=change_site&id=$1 [L]
RewriteRule ^s,([0-9]+),([0-9]+),([^,]+)$ index.php?rw=change_site&id=$1&bs=$2 [L]

RewriteRule ^a,([0-9]+),([^,]+)$ index.php?art=$1 [L]

RewriteRule ^rejestracja$ index.php?rw=change_site&type=registration [L]
RewriteRule ^odzyskaj_haslo$ index.php?rw=change_site&type=password_recovery [L]
RewriteRule ^wyszukiwarka$ index.php?rw=change_site&type=search [L]
RewriteRule ^([0-9]+),wyszukiwarka$ index.php?rw=change_site&type=search&bs=$1 [L]
RewriteRule ^mapa_strony$ index.php?rw=change_site&type=sitemap [L]
RewriteRule ^pobierz,([0-9]+)$ index.php?download=$1 [L]

<files htaccess.conf>
Order deny,allow
deny from all
</files>
<files database.conf>
Order deny,allow
deny from all
</files>