RewriteEngine On
# Přesměrování z www na non-www (nebo naopak)
RewriteCond %{HTTP_HOST} ^www\.deratizace-deraspol\.cz [NC]
RewriteRule ^(.*)$ https://deratizace-deraspol.cz/$1 [L,R=301]
# Přesměrování z HTTP na HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Odstranění .html z URL
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html [L]
# Přesměrování starých URL (pokud měníte strukturu)
Redirect 301 /old-page.html https://deratizace-deraspol.cz/jihomoravsky-kraj/brno.html
# Komprese GZIP pro rychlejší načítání
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript application/json
</IfModule>
# Nastavení cache pro statické soubory
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"ExpiresByType image/gif "přístup plus 1 rok"
ExpiresByType image/png "access plus 1 year"ExpiresByType image/png "přístup plus 1 rok"
ExpiresByType image/webp "access plus 1 year"ExpiresByType image/webp "přístup plus 1 rok"
ExpiresByType text/css "access plus 1 month"ExpiresByType text/css "přístup plus 1 měsíc"
ExpiresByType application/javascript "access plus 1 month"ExpiresByType aplikace/javascript "přístup plus 1 měsíc"
ExpiresByType text/javascript "access plus 1 month"ExpiresByType text/javascript "přístup plus 1 měsíc"
ExpiresByType application/pdf "access plus 1 month"ExpiresByType application/pdf "přístup plus 1 měsíc"
ExpiresByType text/html "access plus 0 seconds"ExpiresByType text/html "přístup plus 0 sekund"
</IfModule></IfModule>
# Bezpečnostní hlavičky
<IfModule mod_headers.c><IfModule mod_headers.c>
Header set X-Content-Type-Options "nosniff"Sada záhlaví X-Content-Type-Options "nosniff"
Header set X-Frame-Options "SAMEORIGIN"Sada hlav X-Frame-Options "SAMEORIGIN"
Header set X-XSS-Protection "1; mode=block"Sada záhlaví X-XSS-Protection "1; režim=blok"
Header set Referrer-Policy "strict-origin-when-cross-origin"Sada záhlaví Referrer-Policy "strict-origin-when-cross-origin"
</IfModule></IfModule>
# Vlastní chybové stránky
ErrorDocument 404 /404.htmlErrorDocument 404 /404.html
ErrorDocument 500 /500.htmlErrorDocument 500 /500.html
# Blokování přístupu k citlivým souborům
<FilesMatch "^\.">
Order allow,denyObjednávka povolit, zamítnout
Deny from allOde všech popřít
</FilesMatch>
monica-translate-translatable-node-parent-el="m">monica-translate-translatable-node-parent-el="m">.htaccessVložte svůj text...