AddDefaultCharset utf-8
<Files ".htaccess">
deny from all
</Files>
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
ErrorDocument 404 /404.html
ErrorDocument 403 /403.html
#
RewriteRule ^index.html$ /$1 [L,R=301]
# admin
RewriteRule ^admin/$ admin/index.php
RewriteRule ^admin.html$ admin/index.php
RewriteRule ^admin$ admin/index.php
# captcha
RewriteRule ^captcha.php$ mycode/captcha.php
# photo
RewriteRule ^photo-cat-([-a-zA-Z0-9_]*)?-([0-9]*)?.html$ index.php?whatpage=photo&cat=$1&page=$2
RewriteRule ^photo-cat-([-a-zA-Z0-9_]*).html? index.php?whatpage=photo&cat=$1
RewriteRule ^photo-([0-9]*).html? index.php?whatpage=photo&page=$1
# news
RewriteRule ^news/index.php$ /news/ [QSA,R]
RewriteRule ^news/$ index.php?whatpage=news
RewriteRule ^news.html$ /news/ [QSA,R]
RewriteRule ^news/page([0-9]*)?.html$ index.php?whatpage=news&newspage=$1
RewriteRule ^news/([-a-zA-Z0-9_]*)/?index.php$ /news/$1/ [QSA,R]
RewriteRule ^news/([-a-zA-Z0-9_]*)/?page([0-9]*)?.html$ index.php?whatpage=news&catnews=$1&newspage=$2
RewriteRule ^news/([-a-zA-Z0-9_]*)?.html$ index.php?whatpage=news&view=$1
RewriteRule ^news/([-a-zA-Z0-9_]*)/?$ index.php?whatpage=news&catnews=$1
RewriteRule ^news/([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)?.html$ index.php?whatpage=news&catnews=$1&view=$2
# guestbook
RewriteRule ^guestbook-start-([0-9]*).html?$ index.php?whatpage=guestbook&start=$1
RewriteRule ^guestbook-post-([0-9]*).html?$ index.php?whatpage=guestbook&id=$1
# pages
RewriteRule ^([-a-zA-Z0-9_]*)?.html$ index.php?whatpage=$1
RewriteRule ^([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)/?spage-([0-9]*)?.html$ index.php?catpage=$1&subcatpage=$2&spage=$3
RewriteRule ^([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)?.html$ index.php?catpage=$1&whatpage=$2
RewriteRule ^([-a-zA-Z0-9_]*)/?$ index.php?catpage=$1
RewriteRule ^([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)?.html$ index.php?catpage=$1&subcatpage=$2&whatpage=$3
RewriteRule ^([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)/?$ index.php?catpage=$1&subcatpage=$2
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)$ $1.html [NC,L]