# BEGIN Deepthroat
<IfModule mod_rewrite.c>
ErrorDocument 404 /error.html
RewriteEngine On
#禁止运行php 但允许 css|js|gif|jpg|jpeg|png|swf|html #admini|config|content|editor|keditor|inc|setup|skins|temp|upload|xml
#一级目录禁止
RewriteCond %{REQUEST_URI} ^/(config|content|editor|keditor|inc|setup|skins|temp|upload|xml)(/|)$ [NC]
RewriteRule .*$ - [F,L]
#二级以及更深目录禁止
RewriteCond %{REQUEST_URI} ^/(admini|config|content|editor|keditor|inc|setup|skins|temp|xml)/(.*)[^\.(js|css|gif|jpg|jpeg|png|swf|html)]$ [NC]
RewriteRule .*$ - [F,L]

#禁用php文件 editor xml 除外
RewriteCond %{REQUEST_URI} ^/(config|content|skins|temp|upload)/.*\.(php|jsp|asp|aspx|cgi|sql|lock)$ [NC]
RewriteRule .*$ - [F,L]
RewriteCond %{REQUEST_URI} ^/admini/(.+)[^index|login|html].*\.php$ [NC]
RewriteRule .*$ - [F,L]
RewriteCond %{REQUEST_URI} ^/inc/(.+)[^verifycode|lable/lable|lable/lable_edit|pay/alipay|pay/tenpay|models/index].*\.php$ [NC]
RewriteRule .*$ - [F,L]

RewriteRule ^admini[/|]$ /admini/index.php [L]
RewriteRule ^(index.htm)$ / [L]
RewriteRule ^(index.html)$ / [L]

RewriteRule ^([^./][a-z0-9A-Z_-]+)[/|]$ /?f=$1 [L]
RewriteRule ^([^./][a-z0-9A-Z_-]+)$ /?f=$1 [L]
RewriteRule ^([^./][a-z0-9A-Z_-]+)[/|]index.htm$ /?f=$1 [L]
RewriteRule ^([^./][a-z0-9A-Z_-]+)[/|]index.html$ /?f=$1 [L]

###表单action
RewriteRule ^([^./][a-z0-9A-Z_-]+)/action_([a-zA-Z]+).html$ /?f=$1&a=$2 [L]
RewriteRule ^([^./][a-z0-9A-Z_-]+)/action_([a-zA-Z]+)_([0-9]+).html$ /?f=$1&a=$2&r=$3 [L]

###评论action
RewriteRule ^([^./][a-z0-9A-Z_-]+)/comment_([0-9]+).html$ /?f=$1&a=view_comment&r=$2 [L]
RewriteRule ^([^./][a-z0-9A-Z_-]+)/comment_([0-9]+)_([0-9]+).html$ /?f=$1&a=view_comment&r=$2&comment_mdtp=$3 [L]

RewriteRule ^([^./][a-z0-9A-Z_-]+)/comment_([a-z0-9A-Z]+)_([0-9]+).html$ /?f=$1&a=$2&r=$3 [L]
RewriteRule ^([^./][a-z0-9A-Z_-]+)/comment_([a-z0-9A-Z]+)_([0-9]+)_([0-9]+).html$ /?f=$1&a=$2&comment=$3&comment_mdtp=$4 [L]

###内容页
RewriteRule ^([^./][a-z0-9A-Z_-]+)/([a-zA-Z_-]+)([0-9]+).html$ /?f=$1&a=view&r=$3 [L]

###内容分页
RewriteRule ^([^./][a-z0-9A-Z_-]+)/([0-9]+)(|/)$ /?f=$1&mdtp=$2 [L]

RewriteRule ^([^./][a-z0-9A-Z_-]+)/([a-z0-9A-Z_-]+)([0-9]+).html/([0-9]+)(|/)$ /?f=$1&a=view&r=$3&c=$4 [L]

RewriteRule ^([^./][a-z0-9A-Z_-]+)/([a-z0-9A-Z]+).html$ /?f=$1&a=$2 [L]
RewriteRule ^([^./][a-z0-9A-Z_-]+)/([a-z0-9A-Z_-]+)/([0-9]+)(|/)$ /?f=$1&a=$2&mdtp=$3 [L]
###
RewriteRule ^([^./][a-zA-Z]+).html$ /?m=$1 [L]
RewriteRule ^([^./][a-zA-Z]+)_([a-z0-9A-Z]+).html$ /?m=$1&a=$2 [L]
RewriteRule ^([^./])search_([a-z0-9A-Z%-]+)_([0-9]+).html$ /?m=search&keyword=$2&i=$3 [L]

RewriteRule ^([^./][a-z0-9A-Z_-]+)/rss_([0-9]+).html$ /?f=$1&i=$2 [L]
RewriteRule ^([^./][a-z0-9A-Z_-]+)/rss_([0-9]+)_([0-9]+).html$ /?f=$1&a=get_rss&r=$2&i=$3 [L]
</IfModule>
# END Deepthroat