Options -Indexes
<Files post>
ForceType application/x-httpd-php
</Files>

<Files archives>
ForceType application/x-httpd-php
</Files>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#RewriteCond %{QUERY_STRING} ^[^=]*$
#RewriteCond %{QUERY_STRING} %2d|\- [NC]
#RewriteRule .? - [F,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^special/comment(-|/)([0-9]+)-([0-9]+).html$ special.php?comment-$2-$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^special/([a-zA-Z0-9_\-]+)*(.html)?$ special.php?index-$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^special/([a-zA-Z0-9_]+)*(/index.html|/)?$ special.php?topic-$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^special/([a-zA-Z0-9_]+)/list-([0-9]+)*(-([0-9]+))?.html$ special.php?list-$1-$2-$4 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^submission(-(news|article|soft|code)(-([0-9]+))*)?.html$ apps/index.php?action=submission&do=$2&chanid=$4 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(comment|sitemap|tag|new|hot|vote|announce)(/([a-zA-Z0-9_-]+))?.html$ apps/index.php?$1-$3 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(\w+)/(index.html)?$ /apps/index.php?channel=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(article|soft|photo|video)/(misc-)?(person|years|country|quality|language|license|softtype|softlang)-(\w+)(-([0-9]+))? apps/index.php?misc-$3-$4-$6.html&channel=$1 [L]
#RewriteRule ^(article|soft|photo|video)/misc-(.+)(.html|/)?$ apps/index.php?misc-$2&channel=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(article|soft|photo|video|code|tech)/?([^\.]*)/(preview|list|view|down|misc|play|type)-([a-zA-Z0-9_-]+)(.html|/)?$ apps/index.php?$3-$4.html&channel=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(article|soft|photo|video|code|tech)/?([^\.]*)/(list|softlist|techlist)-([a-zA-Z0-9_-]+)(.html|/)?$ apps/index.php?list-$4.html&channel=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(article|soft|photo|video)/?([^\.]*)/([a-zA-Z0-9_]+)-(\d+)-(\d+)(.html|/)?$ apps/index.php?action=list&catid=$4&page=$5&channel=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(article|soft|photo|video)/(\d+(-([0-9]+))?)/([^\/]*)(/index.html|/)?$ apps/index.php?action=view&tid=$2&page=$4&channel=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(article|soft|photo|video)/?([^\.]*)/(\d+)(-(\d+))?(.html|/)?$ apps/index.php?view-$3-$5.html&channel=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(article|soft|photo|video)/([a-zA-Z0-9_]+)/?(\w*(-([0-9]+))?)(/|index.html|.html)?$ apps/index.php?action=list&name=$2&page=$5&channel=$1 [L]

RewriteRule ^member*(_([a-zA-Z0-9]+))?.html$ member.php?action=$2 [L]
</IfModule>