RewriteEngine On 
php_flag display_errors off
php_flag display_startup_errors off

#Chybove stranky
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.*)/(.*)/(.*)\.html
RewriteRule ^(.*)/(.*)/(.*)\.html$ index.php?kat=$1&podkat=$2&prod=$3 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.*)/(.*)\.html
RewriteRule ^(.*)/(.*)\.html$ index.php?kat=$1&prod=$2 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.*)\.html
RewriteRule ^(.*)\.html$ index.php?prod=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.*)/(.*)/
RewriteRule ^(.*)/(.*)/$ index.php?kat=$1&podkat=$2 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.*)\.htm
RewriteRule ^(.*)\.htm$ index.php?txt=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ index.php?kat=$1 [L,QSA]
