#           /**
#          * @Author Ghost
#          * @Copyright 2013
#          * @Version 4.0
#          * @Description Open Forums And Multi-Room Chat Script
#          * @FileSource Flat File (.txt)
#          * @Setup Functions, Sessions, Encrypted Passwords
#          * @HTMLVersion Xhtml 1.0 Transitional EN
#          * @CssVersion Css3  
#          **/
#
#         This .htaccess file protects your .txt files.
#         your .htaccess file itself, tries to stop malicious attacks.
#         it also add seo friendly options. combined with my own php setup
#         to also convert the "forums" links to look seo friendly check conf.php to turn that on or off.
#         ---- Make Sure you upload it or you wont be protected. or get these benefits ----
#

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

DirectoryIndex index.php index.htm index.html

<Files .htaccess>
order allow,deny
deny from all
</files>

<Files *.txt>
order deny,allow
deny from all
</Files>

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>

<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

# Do not remove these lines, otherwise mod_rewrite rules will stop working correctly
Options +FollowSymLinks
RewriteEngine On
# RewriteBase Rule / = Public_html Folder (Change This If Placed In Different Directory)
RewriteBase /

RewriteRule ^(.*)/page/(.*)/thread/(.*)/$ /forum/thread.php?forum=$1&page=$2&thread=$3 [L]
RewriteRule ^(.*)/page/(.*)/thread/(.*)$ /forum/thread.php?forum=$1&page=$2&thread=$3 [L]
RewriteRule ^([a-zA-Z0-9\-]+)/$ /forum/list.php?forum=$1 [L]
RewriteRule ^([a-zA-Z0-9\-]+)$ /forum/list.php?forum=$1 [L]

RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]
