.htaccess

#!
# Using a gazillion porn URLs for CSS
Deny from 134.17.0.0/16
# 78.47.71.224 - 78.47.71.255
# Deny from 78.47.71.224/27
# 5.9.167.144 - 5.9.167.159
# Deny from 5.9.167.144/28
# tons of useless requests
Deny from 192.99.0.0/16
Deny from 62.219.8.227
Deny from 192.162.241.79

# DirectoryIndex cw.pl

Options +FollowSymLinks +SymLinksIfOwnerMatch

# BANNING happens in the config file!

# about 50MB should be enough (reading log files and all that)
# but only works for Apache 2.0 in .htaccess
# RLimitMEM 50000000

# C-x h M-| ~/src/oddmuse/scripts/cli/wikiput -u AlexSchroeder -s "update" "https://communitywiki.org/wiki/.htaccess"

RedirectMatch permanent ^/$ https://communitywiki.org/wiki
RedirectMatch permanent ^/[-a-z]*password http://www.emacswiki.org/pwd.html
RedirectMatch permanent ^/[a-z]*/visitors http://www.emacswiki.org/visitors.html

RedirectMatch permanent ^/cgi-bin/zen\.pl(.*) http://communitywiki.org/zen$1
RedirectMatch permanent ^/cgi-bin/mark\.pl(.*) http://communitywiki.org/mark$1
RedirectMatch permanent ^/odd/MarkDilley(.*) http://communitywiki.org/mark$1

RewriteEngine on

# anybody can get the robots.txt file
RewriteRule ^robots.txt$ - [last]

# Deny all idiots that are looking for borked PHP applications
# Status Code 402 is "Payment Required".
RewriteRule \.php$ - [redirect=402]

# block bot which ignore CrawlDelay
RewriteCond %{HTTP_USER_AGENT} (MegaIndex|SEOkicks-Robot|AhrefsBot)
RewriteRule ^.* - [forbidden,last]

# block bingbot following search links or any other sort of action
RewriteCond %{HTTP_USER_AGENT} (bingbot|ahrefsbot)
RewriteCond %{QUERY_STRING} .
RewriteRule ^.* - [forbidden,last]

# serve favicon as PNG
RewriteRule ^favicon.ico /pics/favicon.png [last,type=image/png]

# http://communitywiki.org/green.css
# http://communitywiki.org/pics/
# http://communitywiki.org/pics/Community.png

RewriteCond %{REQUEST_FILENAME} -f [ornext]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [last]

# http://communitywiki.org/wiki/rss
RewriteRule ^rss /wiki?action=rss [last]

# http://communitywiki.org/wiki/atom
# RewriteRule ^atom /wiki?action=atom [last]

# RewriteRule ^mark/?$  /cgi-bin/mark.pl   [last]
# RewriteRule ^mark(.*) /cgi-bin/mark.pl$1 [last]

# RewriteRule ^zen/?$  /cgi-bin/zen.pl   [last]
# RewriteRule ^zen(.*) /cgi-bin/zen.pl$1 [last]

# https://communitywiki.org/cw/test
# https://communitywiki.org/cw?action=browse&id=test
# https://communitywiki.org/cw-en/test
# https://communitywiki.org/cw-en?action=browse&id=test
# https://communitywiki.org/cgi-bin/cw-en/test
# https://communitywiki.org/cgi-bin/cw-en?action=browse&id=test
# https://communitywiki.org/cgi-bin/cw-en.pl/test
# https://communitywiki.org/cgi-bin/cw-en.pl?action=browse&id=test
# https://communitywiki.org/en?action=browse&id=test
RewriteRule ^(cgi-bin/)?(cw(-[a-z][a-z])?|de|en|fr)(\.pl)?(/.*)? https://communitywiki.org/wiki$5 [redirect,last]

# http://communitywiki.org/raw/HowTo
# http://communitywiki.org/HowTo
RewriteRule ^([^/]+)$ https://communitywiki.org/wiki/$1 [redirect,last]

AddDefaultCharset utf-8

Languages: