#Turn on Rewrite engine
RewriteEngine on
<files archiv>
ForceType application/x-httpd-php
#AcceptPathInfo On # uncomment this if you have apache2
</files>
#DirectoryIndex index.html index.htm umzug.php start.php portal.php index.php
ErrorDocument 404 /search404.php
DirectoryIndex index.html portal.php index.php index.htm
RewriteCond %{HTTP_HOST} !^
www.bm-community.de
RewriteRule (.*) http://www.bm-community.de%{REQUEST_URI} [R=301,L]
#security
RewriteCond %{HTTP_REFERER} ^.*$
RewriteRule ^.*%27.*$
http://www.bm-community.de/ [redirect,last]
RewriteRule ^.*%25.*$
http://www.bm-community.de/ [redirect,last]
RewriteRule ^.*rush=.*$
http://www.bm-community.de/ [redirect,last]
RewriteRule ^.*echr.*$
http://www.bm-community.de/ [redirect,last]
RewriteRule ^.*esystem.*$
http://www.bm-community.de/ [redirect,last]
RewriteRule ^.*wget.*$
http://www.bm-community.de/ [redirect,last]
# prevent pre php 4.3.10 bug
RewriteCond %{HTTP_COOKIE}% s:(.*):%22test1%22%3b
RewriteRule ^.*$
http://www.bm-community.de/ [R,L]
# prevent perl user agent (most often used by santy)
RewriteCond %{HTTP_USER_AGENT} ^lwp.* [NC]
RewriteRule ^.*$
http://www.bm-community.de/ [R,L]
RewriteCond %{HTTP_REFERER} ^.*$
###
# View Category
RewriteCond %{REQUEST_URI} ^/vcat,([0-9]*).htm*
RewriteRule ^(.*) /index.php?c=%1 [L]
# View Forum
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1 [L]
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*),-(.*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1 [L]
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*),([0-9]*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&start=%2 [L]
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*),([0-9]*),-(.*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&start=%2 [L]
RewriteCond %{REQUEST_URI} ^/pforum,([0-9]*),([0-9]*),([0-9]*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&topicdays=%2&start=%3 [L]
# View Forum
RewriteCond %{REQUEST_URI} ^/mforum,([0-9]*),([a-zA-Z0-9]*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&mark=%2 [L]
# View Topic -- after first page
RewriteCond %{REQUEST_URI} ^/ltopic,([0-9]*),([0-9]*),([a-zA-Z0-9]*),([0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&start=%4 [L]
# View Topic -- after first page
#lhtopic,426,0,asc,%FCber%2A,0.html #viewtopic.php?t=426&postdays=0&postorder=asc&highlight=%FCber%2A&start=15
#lhtopic,426,0,0,asc,%FCber%2A.html #viewtopic.php?t=426&start=0&postdays=0&postorder=asc&highlight=%FCber%2A
#lhtopic,568,0,0,asc,setbm=true.html #viewtopic.php?t=568&start=0&postdays=0&postorder=asc&highlight=&setbm=true
RewriteCond %{REQUEST_URI} ^/lhtopic,([0-9]*),([0-9]*),([a-z]*),(.*),([0-9?]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&highlight=%4&start=%5 [L]
RewriteCond %{REQUEST_URI} ^/lhtopic,([0-9]*),([0-9?]*),([0-9]*),([a-z]*),(.*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%3&postorder=%4&highlight=%5&start=%2 [L]
RewriteCond %{REQUEST_URI} ^/lhtopic,([0-9]*),([0-9?]*),([0-9]*),([a-z]*),(.*),([a-z]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%3&postorder=%4&highlight=%5&start=%2&setbm=%6 [L]
# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/stopic,([0-9]*),([0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?p=%1#%2 [L]
# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/htopic,([0-9]*),([^,]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&highlight=%2 [L]
RewriteCond %{REQUEST_URI} ^/htopic,([0-9]*),([0-9]*),([^,]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2&highlight=%3 [L]
# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/vtopic,([0-9]*),([a-zA-Z0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&view=%2 [L]
# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/ptopic,([0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?p=%1#%2 [L]
RewriteCond %{REQUEST_URI} ^/ptopic,([0-9]*),([^,]*).htm*
RewriteRule ^(.*) /viewtopic.php?p=%1&highlight=%2#%3 [L]
# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1 [L]
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*),-(.*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1 [L]
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*),([0-9]*),-(.*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2 [L]
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*),([0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2 [L]
#vote result
RewriteCond %{REQUEST_URI} ^/utopic,([0-9]*),([0-9]*),([a-zA-Z0-9]*),([a-zA-Z0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&vote=%4 [L]
#with session
#############
# View Forum
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&sid=%2 [L]
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*),([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&start=%2&sid=%3 [L]
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*),([a-fA-F0-9]{32}),-(.*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&sid=%2 [L]
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*),([0-9]*),([a-fA-F0-9]{32}),-(.*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&start=%2&sid=%3 [L]
RewriteCond %{REQUEST_URI} ^/pforum,([0-9]*),([0-9]*),([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&topicdays=%2&start=%3&sid=%4 [L]
# View Forum
RewriteCond %{REQUEST_URI} ^/mforum,([0-9]*),([a-zA-Z0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&mark=%2&sid=%3 [L]
# View Topic -- after first page
RewriteCond %{REQUEST_URI} ^/ltopic,([0-9]*),([0-9]*),([a-zA-Z0-9]*),([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&start=%4&sid=%5 [L]
# View Topic -- after first page
RewriteCond %{REQUEST_URI} ^/lhtopic,([0-9]*),([0-9]*),([a-z]*),([^,]*),([0-9?]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&highlight=%4&start=%5&sid=%6 [L]
RewriteCond %{REQUEST_URI} ^/lhtopic,([0-9]*),([0-9?]*),([0-9]*),([a-z]*),([^,]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%3&postorder=%4&highlight=%5&start=%2&sid=%6 [L]
RewriteCond %{REQUEST_URI} ^/lhtopic,([0-9]*),([0-9?]*),([0-9]*),([a-z]*),(.*),([a-z]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%3&postorder=%4&highlight=%5&start=%2&setbm=%6&sid=%7 [L]
# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/stopic,([0-9]*),([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?p=%1&sid=%2#%3 [L]
# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/htopic,([0-9]*),([^,]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&highlight=%2&sid=%3 [L]
RewriteCond %{REQUEST_URI} ^/htopic,([0-9]*),([0-9]*),([^,]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2&highlight=%3&sid=%4 [L]
# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/vtopic,([0-9]*),([a-zA-Z0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&view=%2&sid=%3 [L]
# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/ptopic,([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?p=%1&sid=%2#%3 [L]
RewriteCond %{REQUEST_URI} ^/ptopic,([0-9]*),([^,]*),([[a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?p=%1&highlight=%2&sid=%3#%4 [L]
# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&sid=%2 [L]
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*),([a-fA-F0-9]{32}),-(.*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&sid=%2 [L]
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*),([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2&sid=%3 [L]
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*),([0-9]*),([a-zA-Z0-9]*),-(.*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2&sid=%3 [L]
#vote result
RewriteCond %{REQUEST_URI} ^/utopic,([0-9]*),([0-9]*),([a-zA-Z0-9]*),([a-zA-Z0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&vote=%4&sid=%4 [L]