« 30x Faster Cache and Site Speed with TMPFSQuestions I Ask Web Hosting Companies, Before Buying »
Actual Htaccess Files from My Server
April 17th, 2010
### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#
#
# TZ: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
SetEnv TZ America/Indianapolis
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
SetEnv SERVER_ADMIN webmaster@askapache.com
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.0/mod/core.html#options
# for more information.
#
Options +FollowSymLinks -ExecCGI -Indexes -Includes -MultiViews
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
DirectoryIndex index.html index.php /index.php
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<filesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</filesMatch>
#
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/html
#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of: On | Off | EMail
#
ServerSignature Off
##############################################
# HEADERS and CACHING #
##############################################
Header unset Pragma
Header unset Last-Modified
FileETag None
Redirect 400 /e/400
Redirect 401 /e/401
Redirect 402 /e/402
Redirect 403 /e/403
Redirect 404 /e/404
Redirect 405 /e/405
Redirect 406 /e/406
Redirect 407 /e/407
Redirect 408 /e/408
Redirect 409 /e/409
Redirect 410 /e/410
Redirect 411 /e/411
Redirect 412 /e/412
Redirect 413 /e/413
Redirect 414 /e/414
Redirect 415 /e/415
Redirect 416 /e/416
Redirect 417 /e/417
Redirect 418 /e/418
Redirect 419 /e/419
Redirect 420 /e/420
Redirect 421 /e/421
Redirect 422 /e/422
Redirect 423 /e/423
Redirect 424 /e/424
Redirect 425 /e/425
Redirect 426 /e/426
Redirect 500 /e/500
Redirect 501 /e/501
Redirect 502 /e/502
Redirect 503 /e/503
Redirect 504 /e/504
Redirect 505 /e/505
Redirect 506 /e/506
Redirect 507 /e/507
Redirect 508 /e/508
Redirect 509 /e/509
Redirect 510 /e/510
#
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
##############################################
# PERMANENT REDIRECTS #
##############################################
Redirect 301 /12-lessons-for-those-afraid-of-css.html http://www.askapache.com/css/12-lessons-for-those-afraid-of-css.html
Redirect 301 /2006/htaccess/htaccesselite-ultimate-htaccess-article.html http://www.askapache.com/htaccess/apache-htaccess.html
Redirect 301 /2007/phpbb/sending-post-form-data-with-php-curl.html http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html
Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.askapache.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.askapache.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
Redirect 301 /2007/webmaster/php-and-ajax-shell-console.html http://www.askapache.com/tools/php-and-ajax-shell-console.html
Redirect 301 /27-request-methods-for-use-with-apache-and-rewritecond-and-htaccess.html http://www.askapache.com/htaccess/27-request-methods-for-use-with-apache-and-rewritecond-and-htaccess.html
Redirect 301 /404-google-wordpress-plugin.html http://www.askapache.com/seo/404-google-wordpress-plugin.html
Redirect 301 /503-service-temporarily-unavailable.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /Overview-about.rdf http://www.askapache.com/askapache-home.rdf
Redirect 301 /abbr-acronym.html http://www.askapache.com/xhtml/abbr-acronym.html
Redirect 301 /adsense-robots.html http://www.askapache.com/google/adsense-robots.html
Redirect 301 /alexa-toolbar-firefox.html http://www.askapache.com/tools/alexa-toolbar-firefox.html
Redirect 301 /allowing-access-from-1-static-ip-and-deny-the-rest.html http://www.askapache.com/htaccess/apache-htaccess.html
Redirect 301 /anti-virus-spyware-rootkit.html http://www.askapache.com/security/anti-virus-spyware-rootkit.html
Redirect 301 /apache-ssl-in-htaccess-examples.html http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html
Redirect 301 /awk-tutorial.html http://www.askapache.com/awk/awk-tutorial.html
Redirect 301 /best-adsense-optimization.html http://www.askapache.com/wordpress/best-adsense-optimization.html
Redirect 301 /commonly-used-htaccess-code-examples.html http://www.askapache.com/htaccess/commonly-used-htaccess-code-examples.html
Redirect 301 /css-background-image-sprite.html http://www.askapache.com/css/css-background-image-sprite.html
Redirect 301 /css-browser-screenshots.html http://www.askapache.com/tools/css-browser-screenshots.html
Redirect 301 /css-class-example.html http://www.askapache.com/css/css-class-example.html
Redirect 301 /curl-multi-downloads.html http://www.askapache.com/php/curl-multi-downloads.html
Redirect 301 /custom-boot-menu-in-windows-xp.html http://www.askapache.com/windows/custom-boot-menu-in-windows-xp.html
Redirect 301 /donate http://www.dreamhost.com/donate.cgi?id=8261
Redirect 301 /donate/ http://www.dreamhost.com/donate.cgi?id=8261
Redirect 301 /htaccess.txt http://z.askapache.com/p/htaccess.txt
Redirect 301 /htaccess/404-errorpages.html http://www.askapache.com/seo/google-ajax-search-seo-tips.html
Redirect 301 /htaccess/feedsmith http://www.askapache.com/htaccess/feedsmith-htaccess.html
Redirect 301 /htaccess/http-status-codes.html http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html
Redirect 301 /htaccess/instruct-search-engines-to-come-back-to-site-after-you-finish-working-on-it.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /htaccess/speed-up-the-apache-web-server-with-configuration-hacks.html http://www.askapache.com/htaccess/apache-web-server-speed-configuration-hacks.html
Redirect 301 /instruct-search-engines-to-come-back-to-site-after-you-finish-working-on-it.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /security/bypassing-vlan.html http://www.askapache.com/security/hacking-vlan-switched-networks.html
Redirect 301 /security/bypassing-vlanbypassing-vlan.html http://www.askapache.com/security/hacking-vlan-switched-networks.html
Redirect 301 /security/rigging-the-dreamhost-site-of-the-month-contest.html http://www.askapache.com/dreamhost/rigging-the-dreamhost-site-of-the-month-contest.html
Redirect 301 /seo/tailrankcom-robot.html http://www.askapache.com/seo/tailrank-robot.html
Redirect 301 /webmaster/caching-tutorial-for-webmasters.html http://www.askapache.com/htaccess/caching-tutorial-for-webmasters.html
Redirect 301 /webmaster/lft-traceroute-tool.html http://www.askapache.com/tools/lft-traceroute-tool.html
##############################################
# PERMANENT REDIRECTMATCH #
##############################################
#RedirectMatch 301 ^/&(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/&(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/([^/]+)//$ http://www.askapache.com/$1/
RedirectMatch 301 ^/(.+)/htaccesselite-ultimate-htaccess-article.html(.*) http://www.askapache.com/htaccess/apache-htaccess.html
RedirectMatch 301 ^/(.+)\.html/([a-z][a-z])/$ http://www.askapache.com/$1.html
RedirectMatch 301 ^/([\(]+)(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/([^9]*)9O1X.3y(.*)/(.*)$ http://www.askapache.com/$2
RedirectMatch 301 ^/.3y(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/200([0-9])/([0-9])(.*)$ http://www.askapache.com/top-100/
RedirectMatch 301 ^/200([0-9])/([^01])(.*)$ http://www.askapache.com/$2$3
RedirectMatch 301 ^/about/glossary(.*)$ http://www.askapache.com/glossary$1
RedirectMatch 301 ^/apache-speed(.*)$ http://www.askapache.com/htaccess/apache-speed$1
RedirectMatch 301 ^/category/(.+)$ http://www.askapache.com/$1
RedirectMatch 301 ^/docs/(.*)$ http://askapache.info/$1
RedirectMatch 301 ^/htaccess/feedsmith-htaccess(.*) http://www.askapache.com/htaccess/redirecting-wordpress-feeds-to-feedburner.html
RedirectMatch 301 ^/robots-txt(.*)$ http://www.askapache.com/robots.txt
#RedirectMatch 301 ^/wp-content/uploads/(.*)$ http://z.askapache.com/uploads/$1
RedirectMatch 301 ^/z/(.+)$ http://z.askapache.com/$1
RedirectMatch 301 ^/(z|t|i|j|c|p)/(.*)$ http://z.askapache.com/$1/$2
RedirectMatch 301 ^/hosting/?$ http://www.askapache.com/hosting/
##############################################
# TEMPORARY REDIRECTMATCH #
##############################################
RedirectMatch 307 ^/getflash/?$ http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash
RedirectMatch 307 ^/dream/?$ http://www.askapache.com/dreamhost/
RedirectMatch 307 ^/(cse|apachecse|apachecsetest|apachesearch)/?$ http://www.google.com/coop/cse?cx=002660089121042511758%3Akk7rwc2gx0i
#
# Commonly used filename extensions to character sets. You probably
# want to avoid clashes with the language extensions, unless you
# are good at carefully testing your setup after each change.
# See http://www.iana.org/assignments/character-sets for the
# official list of charset names and their respective RFCs.
#
AddDefaultCharset UTF-8
#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
#
AddType 'application/rdf+xml; charset=UTF-8' .rdf
AddType 'application/xhtml+xml; charset=UTF-8' .xhtml
AddType 'application/xhtml+xml; charset=UTF-8' .xhtml.gz
AddType 'text/html; charset=UTF-8' .html
AddType 'text/html; charset=UTF-8' .html.gz
AddType application/octet-stream .rar .chm .bz2 .tgz .msi .pdf .exe
AddType application/vnd.ms-excel .csv
AddType application/x-httpd-php-source .phps
AddType application/x-pilot .prc .pdb
AddType application/x-shockwave-flash .swf
AddType application/xrds+xml .xrdf
AddType text/plain .ini .sh .bsh .bash .awk .nawk .gawk .csh .var .c .in .h .asc .md5 .sha .sha1
AddType video/x-flv .flv
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
# Despite the name similarity, the following Add* directives have nothing
# to do with the FancyIndexing customization directives above.
#
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler php-cgi .php
#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
Action php-cgi /cgi-bin/php.cgi
#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
#100 Continue
#101 Switching Protocols
#102 Processing
#200 OK
#201 Created
#202 Accepted
#203 Non-Authoritative Information
#204 No Content
#205 Reset Content
#206 Partial Content
#207 Multi-Status
#300 Multiple Choices
#301 Moved Permanently
#302 Found
#303 See Other
#304 Not Modified
#305 Use Proxy
#306 unused
#307 Temporary Redirect
#400 Bad Request
#401 Authorization Required
#402 Payment Required
#403 Forbidden
#404 Not Found
#405 Method Not Allowed
#406 Not Acceptable
#407 Proxy Authentication Required
#408 Request Time-out
#409 Conflict
#410 Gone
#411 Length Required
#412 Precondition Failed
#413 Request Entity Too Large
#414 Request-URI Too Large
#415 Unsupported Media Type
#416 Requested Range Not Satisfiable
#417 Expectation Failed
#418 unused
#419 unused
#420 unused
#421 unused
#422 Unprocessable Entity
#423 Locked
#424 Failed Dependency
#425 No code
#426 Upgrade Required
#500 Internal Server Error
#501 Method Not Implemented
#502 Bad Gateway
#503 Service Temporarily Unavailable
#504 Gateway Time-out
#505 HTTP Version Not Supported
#506 Variant Also Negotiates
#507 Insufficient Storage
#508 unused
#509 unused
#510 Not Extended
#ErrorDocument 100 /X/err/1/HTTP_CONTINUE.html
#ErrorDocument 101 /X/err/1/HTTP_SWITCHING_PROTOCOLS.html
#ErrorDocument 102 /X/err/1/HTTP_PROCESSING.html
#ErrorDocument 200 /X/err/2/HTTP_OK.html
#ErrorDocument 201 /X/err/2/HTTP_CREATED.html
#ErrorDocument 202 /X/err/2/HTTP_ACCEPTED.html
#ErrorDocument 203 /X/err/2/HTTP_NON_AUTHORITATIVE.html
#ErrorDocument 204 /X/err/2/HTTP_NO_CONTENT.html
#ErrorDocument 205 /X/err/2/HTTP_RESET_CONTENT.html
#ErrorDocument 206 /X/err/2/HTTP_PARTIAL_CONTENT.html
#ErrorDocument 207 /X/err/2/HTTP_MULTI_STATUS.html
#ErrorDocument 300 /X/err/HTTP_MULTIPLE_CHOICES.html
#ErrorDocument 301 /X/err/HTTP_MOVED_PERMANENTLY.html
#ErrorDocument 302 /X/err/HTTP_MOVED_TEMPORARILY.html
#ErrorDocument 303 /X/err/HTTP_SEE_OTHER.html
#ErrorDocument 304 /X/err/HTTP_NOT_MODIFIED.html
#ErrorDocument 305 /X/err/HTTP_USE_PROXY.html
#ErrorDocument 307 /X/err/HTTP_TEMPORARY_REDIRECT.html
#ErrorDocument 404 /X/err/HTTP_NOT_FOUND.html
ErrorDocument 400 /X/err/4/HTTP_BAD_REQUEST.html
ErrorDocument 401 /X/err/4/HTTP_UNAUTHORIZED.html
ErrorDocument 402 /X/err/4/HTTP_PAYMENT_REQUIRED.html
ErrorDocument 403 /X/err/4/HTTP_FORBIDDEN.html
ErrorDocument 405 /X/err/4/HTTP_METHOD_NOT_ALLOWED.html
ErrorDocument 406 /X/err/4/HTTP_NOT_ACCEPTABLE.html
ErrorDocument 407 /X/err/4/HTTP_PROXY_AUTHENTICATION_REQUIRED.html
ErrorDocument 408 /X/err/4/HTTP_REQUEST_TIME_OUT.html
ErrorDocument 409 /X/err/4/HTTP_CONFLICT.html
ErrorDocument 410 /X/err/4/HTTP_GONE.html
ErrorDocument 411 /X/err/4/HTTP_LENGTH_REQUIRED.html
ErrorDocument 412 /X/err/4/HTTP_PRECONDITION_FAILED.html
ErrorDocument 413 /X/err/4/HTTP_REQUEST_ENTITY_TOO_LARGE.html
ErrorDocument 414 /X/err/4/HTTP_REQUEST_URI_TOO_LARGE.html
ErrorDocument 415 /X/err/4/TTP_UNSUPPORTED_MEDIA_TYPE.html
ErrorDocument 416 /X/err/4/HTTP_RANGE_NOT_SATISFIABLE.html
ErrorDocument 417 /X/err/4/HTTP_EXPECTATION_FAILED.html
ErrorDocument 422 /X/err/4/HTTP_UNPROCESSABLE_ENTITY.html
ErrorDocument 423 /X/err/4/HTTP_LOCKED.html
ErrorDocument 424 /X/err/4/HTTP_FAILED_DEPENDENCY.html
ErrorDocument 426 /X/err/4/HTTP_UPGRADE_REQUIRED.html
ErrorDocument 500 /X/err/5/HTTP_INTERNAL_SERVER_ERROR.html
ErrorDocument 501 /X/err/5/HTTP_NOT_IMPLEMENTED.html
ErrorDocument 502 /X/err/5/HTTP_BAD_GATEWAY.html
ErrorDocument 503 /X/err/5/HTTP_SERVICE_UNAVAILABLE.html
ErrorDocument 504 /X/err/5/HTTP_GATEWAY_TIME_OUT.html
ErrorDocument 505 /X/err/5/HTTP_VERSION_NOT_SUPPORTED.html
ErrorDocument 506 /X/err/5/HTTP_VARIANT_ALSO_VARIES.html
ErrorDocument 507 /X/err/5/HTTP_INSUFFICIENT_STORAGE.html
ErrorDocument 510 /X/err/5/HTTP_NOT_EXTENDED.html
ErrorDocument 404 /index.php?error=404
# 1 YEAR
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header unset P3P
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
</filesMatch>
# 2 HOURS
<filesMatch "\.(html|htm|xml|txt|xsl)$">
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault A3600
</ifModule>
</filesMatch>
RewriteEngine On
RewriteBase /
#RewriteCond %{REQUEST_URI} ^/(stats/|missing\.html|failed_auth\.html|error/).* [NC,OR]
#RewriteCond %{ENV:REDIRECT_STATUS} =200
#RewriteRule .* - [L]
#RewriteCond %{HTTPS} !=on [NC]
#RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /wp-login(.+)\ HTTP/ [NC]
#RewriteRule .+ https://www.askapache.com/wp-login%1 [R,L]
RewriteCond %{REQUEST_URI} ^/(error/.*|w3c/.*|openid/.*|y_key_bf61afd498f7623a\.html|yadis\.xrdf|askapache-home\.rdf|wlmmanifest\.xml|os-description\.xml|labels\.rdf|gnu-fdl\.txt)$ [NC]
RewriteRule .* /X/%1 [L]
RewriteRule ^osq?(.*)$ /wp-content/plugins/wp-opensearch.php?$1 [QSA,L]
RewriteCond %{HTTP_ACCEPT} application/xrds\+xml
RewriteCond %{HTTP_ACCEPT} !application/xrds\+xml\s*;\s*q\s*=\s*0(\.0{1,3})?\s*(,|$)
RewriteRule ^$ http://www.askapache.com/yadis.xrdf [R,L]
RewriteCond %{REQUEST_URI} ^/cgi-bin/(hash|java).cgi$ [NC]
RewriteCond %{HTTP:P3P} ^(([^:]+):(.+))$ [NC]
RewriteRule .* - [E=HTTP_JS:%{HTTP:P3P},E=HTTP_US:%2,E=HTTP_PA:%3]
RewriteCond %{REQUEST_URI} ^/openid.*$ [NC]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},E=REMOTE_USER:%{HTTP:Authorization}]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.+)\.rdf\ HTTP/ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/rdf/%1.html/index.rdf -f
RewriteRule ^(.*)$ /wp-content/rdf/%1.html/index.rdf [L,S=1]
RewriteCond %{HTTP_USER_AGENT} !^(FeedBurner|FeedValidator|talkr.com).* [NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(feed|rdf|rss|rss2|atom|wp-atom|wp-feed|wp-rdf|wp-rss|wp-rss2).*\ HTTP/ [NC]
RewriteRule .* http://feeds.askapache.com/apache/htaccess? [R=302,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.pdf$ /cgi-bin/pdf.php?file=$1.pdf [L,NC]
RewriteCond %{REMOTE_ADDR} ^$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.phps$ /cgi-bin/phps.php?file=$1.php [L,NC]
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD) [OR]
RewriteCond %{QUERY_STRING} !^$ [OR]
RewriteCond %{HTTP_COOKIE} ^.*(comment_author_|wordpress|wp-postpass_).*$ [NC]
RewriteRule ^(.*)$ - [S=6]
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD) [OR]
RewriteCond %{QUERY_STRING} !^$ [OR]
RewriteCond %{HTTP_COOKIE} ^.*(comment_author_|wordpress|wp-postpass_).*$ [NC]
RewriteRule ^(.*)$ - [S=6]
RewriteCond %{HTTP_USER_AGENT} .*W3C_Validator.* [NC]
RewriteCond %{HTTP:Accept-Encoding} gzip [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml.gz -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml.gz [L,S=5]
RewriteCond %{HTTP:Accept} application/xhtml\+xml [NC]
RewriteCond %{HTTP:Accept-Encoding} gzip [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml.gz -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml.gz [L,S=4]
RewriteCond %{HTTP:Accept-Encoding} gzip [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.html.gz -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.html.gz [L,S=3]
RewriteCond %{HTTP_USER_AGENT} .*W3C_Validator.* [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml [L,S=2]
RewriteCond %{HTTP:Accept} application/xhtml\+xml [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml [L,S=1]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.html -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.html [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.+)\.rdf\ HTTP/ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/%1.html/index.rdf -f
RewriteRule ^(.*)$ /wp-content/cache/aa/%1.html/index.rdf [L]
# BEGIN WordPress
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</ifModule>
# END WordPress
##############################################
# SECURITY #
##############################################
SetEnvIf Request_URI "^/(online-tools/js-compress/?|cgi-bin/java\.cgi|wp-admin/.*)" MODSEC_ENABLE=Off
SetEnvIfNoCase Remote_Addr ^208\.113\.134\.190$ MODSEC_ENABLE=Off
SecFilterEngine On
SecFilterCheckURLEncoding On
SecFilterCheckUnicodeEncoding Off
SecFilterScanPOST On
SecAuditEngine RelevantOnly
SecAuditLog /home/askapache/sites/askapache.com/logs/modsec_audit.log
SecFilterDebugLog /home/askapache/sites/askapache.com/logs/modsec_debug.log
SecFilterDebugLevel 1
SecAuditLogRelevantStatus "^(?:1|2(?!00)|5|4(?!04))"
SecFilterDefaultAction "deny,log,auditlog,severity:2,status:403"
#Enforce proper HTTP requests
SecFilterSelective SERVER_PROTOCOL "!^HTTP/(0\.9|1\.0|1\.1)$" "id:340000,rev:1,severity:1,msg:'Bad HTTP Protocol'"
# Only accept request encodings we know how to handle
SecFilterSelective REQUEST_METHOD "!^(GET|HEAD|POST)$" "chain,id:340001,rev:1,severity:2,msg:'Restricted HTTP function'"
SecFilterSelective HTTP_Content-Type "!(^$|^application/x-www-form-urlencoded$|^multipart/form-data)"
#Generic rule for allowed characters, adjust for your site before activating
#SecFilterSelective REQUEST_URI "!^[a-zA-Z0-9\.\+\_\/\-\?\=\&\%\#]+$" "chain,id:390002,rev:1,severity:2,msg:'Restricted HTTP character set'"
#SecFilterSelective REQUEST_URI "!^/(openid|wp-admin|wp-includes|wp-content|wp-login.php)"
# Require Content-Length to be provided with every POST request
SecFilterSelective REQUEST_METHOD "^POST$" "chain,id:340003,rev:1,severity:2,msg:'Content Length not provided with POST'"
SecFilterSelective HTTP_Content-Length "^$"
# Don't accept transfer encodings we know we don't handle
# (and you don't need it anyway)
SecFilterSelective HTTP_Transfer-Encoding "!^$" "id:340004,rev:1,severity:2,msg:'Dis-allowed Transfer Encoding'"
#HTTP response splitting generic sigs
SecFilter "Content-Length\:.*Content-Type\:.*Content-Type\:" "id:340005,rev:1,severity:2,msg:'HTTP response splitting'"
#HTTP response splitting generic sigs
SecFilter "Content-Length\:" "chain,id:340006,rev:1,severity:2,msg:'HTTP response splitting'"
SecFilter "Content-Type\:"
#catch smuggling attacks
SecFilter "^(GET|POST).*Host:.*^(GET|POST)" "id:300012,rev:1,severity:2,msg:'catch smuggling attacks'"
#XSS insertion into Content-Type
SecFilterSelective THE_REQUEST "Content-Type\:.*(<[[:space:]]*(script|about|applet|activex|chrome)*>.*(script|about|applet|activex|chrome)[[:space:]]*>|onmouseover=|javascript\:)" "id:300002,rev:1,severity:2,msg:'XSS attack in Content-type header'"
#Code injection via content length
SecFilterSelective HTTP_Content-Length "\;(system|passthru|exec)\(" "id:330003,rev:1,severity:2,msg:'Code Injection in Content-Length header'"
#Don't accept chunked encodings modsecurity can not look at these, so this is a hole that can bypass your rules, the rule before this one should cover this, but hey paranoia is cheap
SecFilterSelective HTTP_Transfer-Encoding "chunked" "id:300003,rev:1,severity:2,msg:'Chunked Transfer Encoding denied'"
##generic recursion signatures
SecFilterSelective REQUEST_URI "\.\./\.\./" "id:300004,rev:2,severity:2,msg:'Generic Path Recursion1 denied'"
SecFilterSelective THE_REQUEST "\.\|\./\.\|\./\.\|" "id:300005,rev:1,severity:2,msg:'Generic Path Recursion2 denied'"
SecFilterSelective THE_REQUEST "\.\.\./" "id:300006,rev:1,severity:2,msg:'Bogus Path denied'"
#Generic PHP exploit signatures
SecFilterSelective REQUEST_URI "<\?php (chr|fwrite|fopen|system|echr|passthru|popen|proc_open|shell_exec|exec|proc_nice|proc_terminate|proc_get_status|proc_close|pfsockopen|leak|apache_child_terminate|posix_kill|posix_mkfifo|posix_setpgid|posix_setsid|posix_setuid|phpinfo)\(.*\)\;" "id:330002,rev:1,severity:2,msg:'Generic PHP exploit pattern denied'"
#Prevent SQL injection in cookies
SecFilterSelective COOKIE_VALUES "((select|grant|delete|insert|drop|alter|replace|truncate|update|create|rename|describe)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]+[[:space:]]+(from|into|table|database|index|view)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]|UNION SELECT.*\'.*\'.*,[0-9].*INTO.*FROM)" "id:300011,rev:1,severity:2,msg:'Generic SQL injection in cookie'"
#Prevent SQL injection in UA
SecFilterSelective HTTP_USER_AGENT "((select|grant|delete|insert|drop|alter|replace|truncate|update|create|rename|describe)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]+[[:space:]]+(from|into|table|database|index|view)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]|UNION SELECT.*\'.*\'.*,[0-9].*INTO.*FROM)" "id:300012,rev:1,severity:2,msg:'Generic SQL injection in User Agent header'"
# Generic filter to prevent SQL injection attacks
# Understand that all SQL filters are very limited and are very difficult to prevent false postives and negatives.
# Please report false positives/negatives to mike@gotroot.com
SecFilter "((select|grant|delete|insert|drop|alter|replace|truncate|update|create|rename|describe)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]+[[:space:]]+(from|into|table|database|index|view)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]|UNION SELECT.*\'.*\'.*,[0-9].*INTO.*FROM)" "id:300013,rev:1,severity:2,msg:'Generic SQL injection protection'"
#generic XSS PHP attack types
SecFilterSelective REQUEST_URI "\.php\?" "chain,id:300010,rev:1,severity:2,msg:'Generic PHP XSS exploit pattern denied'"
SecFilter "(javascript\:/(.*new\x20ActiveXObject.*Sh\.regwrite|.*window\.opener\.document\.body.\innerHTML=window\.opener\.document\.body\.innerHTML\.replace)|onmouseover=\'javascript)"
#Generic XSS filter
#please report false positives
SecFilterSelective REQUEST_URI "!/mt\.cgi" "chain,msg:'XSS2'"
SecFilter "<[[:space:]]*(script|about|applet|activex|chrome)*>.*(script|about|applet|activex|chrome)[[:space:]]*>"
#XSS in referrer and UA headers
SecFilterSelective HTTP_REFERER|HTTP_USER_AGENT "<[[:space:]]*(script|about|applet|activex|chrome)*>.*(script|about|applet|activex|chrome)[[:space:]]*>" "msg:'XSS3'"
#HTTP header PHP code injection attacks
SecFilterSelective HTTP_CLIENT_IP|HTTP_USER_AGENT|HTTP_Referer "(<\?php|<[[:space:]]?\?[[:space:]]?php|<\? php)" "msg:'PHP1'"
#Generic PHP remote file injection
SecFilterSelective REQUEST_URI "!(/do_command)" "chain,msg:'PHP2'"
SecFilterSelective REQUEST_URI "\.php\?.*=(https?|ftp)\:/.*(cmd|command)="
#script, perl, etc. code in HTTP_Referer string
SecFilterSelective HTTP_Referer "\#\!.*/" "msg:'perl script1'"
#remote file inclusion generic attack signature
SecFilterSelective THE_REQUEST "\.(dat|gif|jpg|png|bmp|txt|vir|dot)\?" "chain,msg:'remote 1'"
SecFilter "((name|pm_path|pagina|path|include_location|root|page|open)=(http|https|ftp)|(cmd|command|inc)=)"
#remote file inclusion generic attack signature
SecFilterSelective THE_REQUEST "\.(dat|gif|jpg|png|bmp|txt|vir|dot)\?\&(cmd|command|inc|name)=" "msg:'remote2'"
#remote file inclusion generic attack signature
SecFilterSelective ARGS "\.(dat|gif|jpg|png|bmp|txt|vir|dot)" "chain,msg:'file inclusion1'"
SecFilter "\?\&(cmd|inc|name)="
#remote file inclusion generic attack signature
SecFilterSelective ARGS "\.(dat|gif|jpg|png|bmp|txt|vir|dot)\?\&(cmd|inc|name)=" "msg:'file inclusion2'"
#remote file inclusion generic attack signature
SecFilterSelective REQUEST_URI "\.php\?.*=(http|https|ftp)\:/.*\?&cmd=" "msg:'file inclusion3'"
#Bogus file extensions generic signature
SecFilterSelective THE_REQUEST "[A-Za-z0-9]\.(gif|jpg|png|bmp)\.txt" "msg:'file extension'"
#PHP remote path attach generic signature
SecFilterSelective REQUEST_URI "\.ph(p(3|4)?).*path=(http|https|ftp)\:/" "msg:'remote path1'"
SecFilterSelective REQUEST_URI "\.php.*path=(http|https|ftp)\:/" "msg:'remote path2'"
#generic php attack sigs
SecFilterSelective REQUEST_URI "(&(cmd|command)=(id|uname)\x20|cmd\?(cmd|command)=|(spy|cmd|cmd_out|sh)\.(gif|jpg|png|bmp|txt)\?&(cmd|command)=|\.php\?&(cmd|command)=)" "msg:'php attack1'"
# WEB-MISC apache directory disclosure attempt
SecFilterSelective THE_REQUEST "////////" "msg:'apache directory disclosure'"
#PHP defenses
SecFilterSelective ARG_PHPSESSID "!^$" "msg:'something in phpsessid'"
SecFilterSelective COOKIE_PHPSESSID "!^$" "msg:'something in cookie phpsessid'"
#PHP defenses
SecFilterSelective COOKIE_ASKAPACHEID "!^[0-9a-z]*$" "msg:'bad value for cookie'"
#cross site scripting attempt TYPE + JAVASCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]text\/javascript" "msg:'cross-site1'"
#cross site scripting attempt STYLE + JAVASCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]application\/x-javascript" "msg:'cross-site1'"
#cross site scripting attempt STYLE + JSCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]text\/jscript" "msg:'cross-site1'"
# cross site scripting attempt STYLE + VBSCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]text\/vbscript" "msg:'cross-site1'"
#cross site scripting attempt STYLE + VBSCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]application\/x-vbscript" "msg:'cross-site1'"
#cross site scripting attempt STYLE + ECMACRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]text\/ecmascript" "msg:'cross-site1'"
# cross site scripting attempt STYLE + EXPRESSION
SecFilterSelective THE_REQUEST "STYLE[\s]*=[\s]*[^>]expression[\s]*\(" "msg:'cross-site1'"
#cross site scripting attempt STYLE + EXPRESSION
SecFilterSelective THE_REQUEST "[\s]*expression[\s]*\([^}]}[\s]*<\/STYLE>" "msg:'cross-site1'"
# cross site scripting attempt using XML
SecFilterSelective THE_REQUEST "<!\[CDATA\[<\]\]>SCRIPT" "msg:'cross-site1'"
#cross site scripting attempt executing hidden Javascript
SecFilterSelective THE_REQUEST "eval[\s]*\([\s]*[^\.]\.innerHTML[\s]*\)" "msg:'cross-site1'"
#cross site scripting attempt executing hidden Javascript
SecFilterSelective THE_REQUEST "window\.execScript[\s]*\(" "msg:'cross-site1'"
#cross site scripting attempt to execute Javascript code
SecFilterSelective THE_REQUEST "/(((URL|SRC|HREF|LOWSRC)[\s]*=)|(url[\s]*[\(]))[\s]*[\'\"]*javascript[\:]" "msg:'cross-site1'"
#cross site scripting stealth attempt to execute Javascript code
#may false alarm for some language sets
SecFilterSelective REQUEST_URI "!(/index\.php\?module=Blocks&type=admin&func=update|/index\.php\?go=.*&edit=)" "chain,msg:'cross-site1'"
SecFilter "(((URL|SRC|HREF|LOWSRC)[\s]*=)|(url[\s]*[\(]))[\s]*[\'\"]*[\x09\x0a\x0b\x0c\x0d]*j[\x09\x0a\x0b\x0c\x0d]*a[\x09\x0a\x0b\x0c\x0d]*v[\x09\x0a\x0b\x0c\x0d]*a[\x09\x0a\x0b\x0c\x0d]*s[\x09\x0a\x0b\x0c\x0d]*c[\x09\x0a\x0b\x0c\x0d]*r[\x09\x0a\x0b\x0c\x0d]*i[\x09\x0a\x0b\x0c\x0d]*p[\x09\x0a\x0b\x0c\x0d]*t[\x09\x0a\x0b\x0c\x0d]*[\:]"
#cross site scripting HTML Image tag set to javascript attempt
SecFilterSelective THE_REQUEST "img src=javascript" "msg:'cross-site1'"
#Fake image file shell attacvk
SecFilterSelective HTTP_Content-Type "image/.*" "msg:'image shell 1'"
SecFilterSelective POST_PAYLOAD "chr\(" "msg:'image shell2'"
#bogus graphics file
SecFilterSelective HTTP_Content-Disposition "\.php" "chain,msg:'bogus graphics'"
SecFilterSelective HTTP_Content-Type "(image/gif|image/jpg|image/png|image/bmp)"
#---------------------------------------------
# reject keywords that appear in POST or GET
#=============================================
SecFilterSignatureAction "nolog,noauditlog,deny,severity:3,status:400"
<files wp-comments-post.php>
# fail for empty comment fields
SecFilterSelective "ARG_comment_post_ID" "^$" "id:50300,msg:'WORDPRESS SPAM MISSING comment_post_ID'"
SecFilterSelective "ARG_comment_post_ID" "!^[0-9]{1,6}$" "id:50301,msg:'WORDPRESS SPAM BAD comment_post_ID'"
#SecFilterSelective "comment_post_DI" "^$" "id:50310,msg:'WORDPRESS SPAM MISSING comment_post_DI'"
#SecFilterSelective "comment_post_DI" "!^[0-9]{1,2}$" "id:50311,msg:'WORDPRESS SPAM MISSING comment_post_DI'"
#SecFilterSelective "ARG_submit" "^Submit.Comment$" "msg:'bad submit comment value'"
</files>
SecFilterSelective ARGS "00bp\.com|360\.yahoo|987mb\.com|Ambien|American airline" "id:50010,msg:'SPAM 10'
SecFilterSelective ARGS "Ativan|Caresoprodol|Darvocet|Ephedra|Ephedrine" "id:50011,msg:'SPAM 11'
#SecFilterSelective ARGS "Gambling|Lexapro|Tramadol|Venlafaxine|\.info" "id:50012,msg:'SPAM 12'
SecFilterSelective ARGS "\[URL=|abgood|acura|acyclovir|adderall" "id:50013,msg:'SPAM 13'
SecFilterSelective ARGS "adipex|alcohol|alprazolam|amateur|amrit" "id:50014,msg:'SPAM 14'
SecFilterSelective ARGS "anal sex|analfinder|angelina jolie|asshole|axspace\.com" "id:50015,msg:'SPAM 15'
SecFilterSelective ARGS "baccarat|bankrupt|bikini|biotic|black jack" "id:50016,msg:'SPAM 16'
SecFilterSelective ARGS "blackjack|blog\.360|brutality|buddhism|butalbital" "id:50017,msg:'SPAM 17'
SecFilterSelective ARGS "cadillac|canalis|card credit|card stud|carisoprodol" "id:50018,msg:'SPAM 18'
SecFilterSelective ARGS "carmen|cash advance|cash credit|casino|catch\.com" "id:50019,msg:'SPAM 19'
SecFilterSelective ARGS "celebrex|celexa|cellulite|cheap|cheerleader" "id:50020,msg:'SPAM 20'
SecFilterSelective ARGS "chevrolet|child abuse|cialis|cigarette|cipro" "id:50021,msg:'SPAM 21'
SecFilterSelective ARGS "citroen|claritin|cleavage|clomid|codeine" "id:50022,msg:'SPAM 22'
SecFilterSelective ARGS "consulting23|craps online|credit card|credit debt|crestor" "id:50023,msg:'SPAM 23'
SecFilterSelective ARGS "dealership|debt free|desnudas|diazepam|dick" "id:50024,msg:'SPAM 24'
SecFilterSelective ARGS "dildo|drugstore|earrings|endometrioma|endowment" "id:50025,msg:'SPAM 25'
SecFilterSelective ARGS "erotic|estrogen|fioricet|francaise|freehost\.com" "id:50026,msg:'SPAM 26'
SecFilterSelective ARGS "freehostia|freemb\.com|fuck|geocities\.com|hacking myspace" "id:50027,msg:'SPAM 27'
SecFilterSelective ARGS "holdem|honda|hotels|hydrocodone|hypnotic" "id:50028,msg:'SPAM 28'
SecFilterSelective ARGS "hyundai|implants|incest|instant approval|insurance" "id:50029,msg:'SPAM 29'
SecFilterSelective ARGS "interracial|jaguar|jenny movie|johanson|kasino" "id:50030,msg:'SPAM 30'
SecFilterSelective ARGS "lesbian|levitra|lipitor|loan|lolita" "id:50031,msg:'SPAM 31'
SecFilterSelective ARGS "lorazepam|lorcet|lyrics|madamic|majorette" "id:50032,msg:'SPAM 32'
SecFilterSelective ARGS "malaria|mastercar|masturbate|masturbation|maturewomen" "id:50033,msg:'SPAM 33'
SecFilterSelective ARGS "mazda|medication|medicine|megsfree5\.com|mercedes" "id:50034,msg:'SPAM 34'
SecFilterSelective ARGS "meridia|metformin|mitsubishi|mortgage|myspace profile" "id:50035,msg:'SPAM 35'
SecFilterSelective ARGS "naked|neocool|nexium|nimire\.com|nissan" "id:50036,msg:'SPAM 36'
SecFilterSelective ARGS "nokia|nude|nudism|nymph|open toe" "id:50037,msg:'SPAM 37'
SecFilterSelective ARGS "oprodol|orgasm|oxycodone|oxycontin|packages" "id:50038,msg:'SPAM 38'
SecFilterSelective ARGS "painrelief|pantyhose|paxil|payday|penis" "id:50039,msg:'SPAM 39'
SecFilterSelective ARGS "percocet|pharmacy|phentermine|phetermine|phpbb_root" "id:50040,msg:'SPAM 40'
SecFilterSelective ARGS "pictaboo|pictorial|pills|pissing|play craps" "id:50041,msg:'SPAM 41'
SecFilterSelective ARGS "playgirl|pocker web|poker|pontiac|poquer" "id:50042,msg:'SPAM 42'
SecFilterSelective ARGS "porn|pounder|prescription|preteen|prevacid" "id:50043,msg:'SPAM 43'
SecFilterSelective ARGS "price1|prilosec|propecia|proza|prozac" "id:50044,msg:'SPAM 44'
SecFilterSelective ARGS "puddled|pussy|refinance|rentals|replica" "id:50045,msg:'SPAM 45'
SecFilterSelective ARGS "ringtones|roulette|screensaver|seduced|sexual" "id:50046,msg:'SPAM 46'
SecFilterSelective ARGS "sexy|shemale|shiloh|singulair|site-host" "id:50047,msg:'SPAM 47'
SecFilterSelective ARGS "slot machine|slot maschine|slots machine|solpip\.com|soma" "id:50048,msg:'SPAM 48'
SecFilterSelective ARGS "sperm|starlets|supplier|suzuki|tadalafil" "id:50049,msg:'SPAM 49'
SecFilterSelective ARGS "toyota|tylenol|ultram|valium|viagra" "id:50050,msg:'SPAM 50'
SecFilterSelective ARGS "vigora|vioxx|wallpaper|warez|webcam" "id:50051,msg:'SPAM 51'
SecFilterSelective ARGS "webpages\.com|wellbutrin|whitesluts|wholesale|whore" "id:50052,msg:'SPAM 52'
SecFilterSelective ARGS "windshield|xanax|xenical|y lohan|yourgirls" "id:50053,msg:'SPAM 53'
SecFilterSelective ARGS "youtube\.com|zantac|sex offenders|hotgay|Zoloft|celtic women" "id:50054,msg:'SPAM 54'
SecFilterSelective ARGS "dollhouse|freehot|kardashian|oralsex" "id:50055,msg:'SPAM 54'
#
# +ASKAPACHE PASSPRO 4.5.2
#######################################################
# __ __
# ____ ______/ /______ _____ ____ ______/ /_ ___
# / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__ ) ,< / /_/ / /_/ / /_/ / /__/ / / / __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
# /_/
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
# +APRO SIDS
# +SID 21030002
Order Deny,Allow
Deny from All
Satisfy Any
AuthType Digest
AuthName "Protected By AskApache"
AuthDigestDomain / http://www.askapache.com/
AuthDigestFile /home/.greer/askapache/sites/askapache.com/.htpasswda3
Require valid-user
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|mp3|mpg|mp4|mov|wav|wmv|png|gif|swf|css|js)$">
Allow from All
</filesMatch>
<filesMatch "(async-upload|admin-ajax)\.php$">
<ifModule mod_security.c>
SecFilterEngine Off
</ifModule>
Allow from All
</filesMatch>
# -SID 21030002
# -APRO SIDS
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
# __ __
# ____ ______/ /______ _____ ____ ______/ /_ ___
# / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__ ) ,< / /_/ / /_/ / /_/ / /__/ / / / __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
# /_/
#######################################################
# -ASKAPACHE PASSPRO 4.5.2
# +ASKAPACHE CRAZYCACHE 2.1
#######################################################
# __ __
# ____ ______/ /______ _____ ____ ______/ /_ ___
# / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__ ) ,< / /_/ / /_/ / /_/ / /__/ / / / __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
# /_/
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
# +ACACHE RULES
# -ACACHE RULES
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
# __ __
# ____ ______/ /______ _____ ____ ______/ /_ ___
# / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__ ) ,< / /_/ / /_/ / /_/ / /__/ / / / __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
# /_/
#######################################################
# -ASKAPACHE CRAZYCACHE 2.1
#
# Directives controlling the display of server-generated directory listings.
#
# Required modules: mod_autoindex, mod_alias
#
# To see the listing of a directory, the Options directive for the
# directory must include "Indexes", and the directory must not contain
# a file matching those listed in the DirectoryIndex directive.
#
Options +Indexes +MultiViews -ExecCGI +FollowSymLinks
DirectoryIndex index.html
#
#
# IndexOptions: Controls the appearance of server-generated directory
# listings.
#
IndexOptions FancyIndexing IconHeight=22 IconWidth=20 IgnoreClient NameWidth=* DescriptionWidth=* ScanHTMLTitles SuppressLastModified XHTML FoldersFirst SuppressHTMLPreamble
#
# AddIcon* directives tell the server which icon to show for different
# files or filename extensions. These are only displayed for
# FancyIndexed directories.
#
AddIconByEncoding (CMP,http://z.askapache.com/i/s/compressed.gif) x-compress x-gzip
AddIconByType (IMG,http://z.askapache.com/i/s/image.gif) image/*
AddIconByType (SND,http://z.askapache.com/i/s/sound2.gif) audio/*
AddIconByType (TXT,http://z.askapache.com/i/s/text.gif) text/*
AddIconByType (VID,http://z.askapache.com/i/s/movie.gif) video/*
AddIcon http://z.askapache.com/i/s/hand.right.gif README
AddIcon http://z.askapache.com/i/s/folder.gif ^^DIRECTORY^^
AddIcon http://z.askapache.com/i/s/dir.png ^^DIRECTORY^^
AddIcon http://z.askapache.com/i/s/blank.gif ^^BLANKICON^^
AddDescription "100 Continue" 100* 100/index.html
AddDescription "101 Switching Protocols" 101* 101/index.html
AddDescription "102 Processing" 102* 102/index.html
AddDescription "200 OK" 200* 200/index.html
AddDescription "201 Created" 201* 201/index.html
AddDescription "202 Accepted" 202* 202/index.html
AddDescription "203 Non-Authoritative Information" 203* 203/index.html
AddDescription "204 No Content" 204* 204/index.html
AddDescription "205 Reset Content" 205* 205/index.html
AddDescription "206 Partial Content" 206* 206/index.html
AddDescription "207 Multi-Status" 207* 207/index.html
AddDescription "300 Multiple Choices" 300* 300/index.html
AddDescription "301 Moved Permanently" 301* 301/index.html
AddDescription "302 Found" 302* 302/index.html
AddDescription "303 See Other" 303* 303/index.html
AddDescription "304 Not Modified" 304* 304/index.html
AddDescription "305 Use Proxy" 305* 305/index.html
AddDescription "306 unused" 306* 306/index.html
AddDescription "307 Temporary Redirect" 307* 307/index.html
AddDescription "400 Bad Request" 400* 400/index.html
AddDescription "401 Authorization Required" 401* 401/index.html
AddDescription "402 Payment Required" 402* 402/index.html
AddDescription "403 Forbidden" 403* 403/index.html
AddDescription "404 Not Found" 404* 404/index.html
AddDescription "405 Method Not Allowed" 405* 405/index.html
AddDescription "406 Not Acceptable" 406* 406/index.html
AddDescription "407 Proxy Authentication Required" 407* 407/index.html
AddDescription "408 Request Time-out" 408* 408/index.html
AddDescription "409 Conflict" 409* 409/index.html
AddDescription "410 Gone" 410* 410/index.html
AddDescription "411 Length Required" 411* 411/index.html
AddDescription "412 Precondition Failed" 412* 412/index.html
AddDescription "413 Request Entity Too Large" 413* 413/index.html
AddDescription "414 Request-URI Too Large" 414* 414/index.html
AddDescription "415 Unsupported Media Type" 415* 415/index.html
AddDescription "416 Requested Range Not Satisfiable" 416* 416/index.html
AddDescription "417 Expectation Failed" 417* 417/index.html
AddDescription "418 unused" 418* 418/index.html
AddDescription "419 unused" 419* 419/index.html
AddDescription "420 unused" 420* 420/index.html
AddDescription "421 unused" 421* 421/index.html
AddDescription "422 Unprocessable Entity" 422* 422/index.html
AddDescription "423 Locked" 423* 423/index.html
AddDescription "424 Failed Dependency" 424* 424/index.html
AddDescription "425 No code" 425* 425/index.html
AddDescription "426 Upgrade Required" 426* 426/index.html
AddDescription "500 Internal Server Error" 500* 500/index.html
AddDescription "501 Method Not Implemented" 501* 501/index.html
AddDescription "502 Bad Gateway" 502* 502/index.html
AddDescription "503 Service Temporarily Unavailable" 503* 503/index.html
AddDescription "504 Gateway Time-out" 504* 504/index.html
AddDescription "505 HTTP Version Not Supported" 505* 505/index.html
AddDescription "506 Variant Also Negotiates" 506* 506/index.html
AddDescription "507 Insufficient Storage" 507* 507/index.html
AddDescription "508 unused" 508* 508/index.html
AddDescription "509 unused" 509* 509/index.html
AddDescription "510 Not Extended" 510* 510/index.html
AddDescription ".htaccess ErrorDocuments" *
#
# HeaderName is the name of a file which should be prepended to
# directory indexes.
ReadmeName /X/error/README.html
HeaderName /X/error/HEADER.html
# DefaultIcon is which icon to show for where none is explicitly set.
DefaultIcon http://z.askapache.com/i/s/generic.gif
#
# IndexIgnore is a set of filenames which directory indexing should ignore
# and not include in the listing. Shell-style wildcarding is permitted.
#
IndexIgnore .??* *_notes *~
RewriteEngine On
RewriteCond %{HTTPS} !=on [NC]
RewriteRule .* https://www.askapache.com%{REQUEST_URI}
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},E=REMOTE_USER:%{HTTP:Authorization}]
#RewriteCond %{QUERY_STRING} openid.mode=authorize
#RewriteCond %{REQUEST_URI} ^/openid.*$ [NC]
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},E=REMOTE_USER:%{HTTP:Authorization}]
Options -Indexes
RewriteEngine On
RewriteCond %{HTTP_COOKIE} !^.*MP3P=([0-9]+).* [NC]
RewriteRule .* - [F,L]
Options +IndexesOptions +Indexes -MultiViews -ExecCGI
ErrorDocument 404 /z/ii/feed5.gif
##############################################
# HEADERS and CACHING #
##############################################
Header unset Pragma
FileETag None
Header unset ETag
# 1 YEAR
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$">
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Last-Modified
</filesMatch>
# 2 HOURS
<filesMatch "\.(html|htm|xml|txt|xsl)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</filesMatch>
<filesMatch "^feed(1|2|3|4|5)?\.gif$">
Header unset Expires
Header set Cache-Control "no-cache, must-revalidate"
</filesMatch>
### COMPRESSION
<filesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Last-Modified
</filesMatch>
RewriteEngine On
RewriteBase /
RewriteRule !^.+\.gif$ - [S=4]
RewriteCond %{TIME_SEC} ^(0|4|8|12|16|22|26|30|34|38|42|46)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^feed\.gif$ /z/ii/feed1.gif [NC]
RewriteCond %{TIME_SEC} ^(1|5|9|13|17|23|27|31|35|39|43|47)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^feed\.gif$ /z/ii/feed2.gif [NC]
RewriteCond %{TIME_SEC} ^(2|6|10|14|18|24|28|32|36|40|44|48)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^feed\.gif$ /z/ii/feed3.gif [NC]
RewriteCond %{TIME_SEC} ^(3|7|11|15|19|25|29|33|37|41|45|49)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^feed\.gif$ /z/ii/feed4.gif [NC]
RewriteCond %{TIME_SEC} ^5([0-9])$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^feed\.gif$ /z/ii/feed5.gif [NC]
RewriteCond %{THE_REQUEST} ^(GET|HEAD)\ /z/([cj]+)/(.+)-([0-9]+)\.(js|css).*\ HTTP/ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ /z/%2/%3.%5 [NC]
RewriteCond %{ENV:REDIRECT_STATUS} =200
RewriteRule .* - [L,NC]
Options +FollowSymLinks
DirectoryIndex index.html
Header set Connection "close"
#SetEnvIfNoCase ^Cookie$ "(.*)" HTTP_MY_COOKIE=$1
#SetEnvIfNoCase Remote_Addr "(.*)" HTTP_MY_REMOTE_ADDR=$1
#ExpiresActive Off
#FileETag None
#Header unset Connection
#Header unset Last-Modified
#Header unset ETag
#Header unset Accept-Ranges
#Header unset Vary
#Header unset Content-Type
Header unset X-Pingback
#Header unset P3P
#Header add RouterBits "%D %t"
#Header add Location "http://www.askapache.com/feed/"
#Header add Found "http://askapache.com/feed/"
#Header add Content-Location "http://www.askapache.com/feed/"
#Header add Refresh "http://www.askapache.com/feed/"
#Header set Hi "%{HTTP_MY_REMOTE_ADDR}e"
Options +FollowSymLinks
AddHandler application/x-httpd-php .php
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} !^tyy+$ [NC]
RewriteCond %{REMOTE_USER} ^(.+)$
RewriteRule ^(.*)$ $1/-%1 [R=302,L]
Options +ExecCGI +FollowSymLinks
DirectoryIndex index.php
ErrorDocument 404 /cgi-bin/pro/index.php
AuthType Digest
AuthName "AskApache Pro"
AuthDigestFile /home/askapache/sites/askapache.com/.htpasswd-pro
AuthDigestDomain /cgi-bin/pro/ http://www.askapache.com/cgi-bin/pro/ https://www.askapache.com/cgi-bin/pro/
Require user askapacheDirectoryIndex p.php
ErrorDocument 403 /cgi-bin/p/p.php
ErrorDocument 401 /cgi-bin/p/p.php
ErrorDocument 500 /cgi-bin/p/p.php
ErrorDocument 503 /cgi-bin/p/p.php
RewriteEngine On
RewriteBase /
RewriteRule .* - [E=INFO_API_VERSION:%{API_VERSION}]
RewriteRule .* - [E=INFO_AUTH_TYPE:%{AUTH_TYPE}]
RewriteRule .* - [E=INFO_CONTENT_LENGTH:%{CONTENT_LENGTH}]
RewriteRule .* - [E=INFO_CONTENT_TYPE:%{CONTENT_TYPE}]
RewriteRule .* - [E=INFO_DOCUMENT_ROOT:%{DOCUMENT_ROOT}]
RewriteRule .* - [E=INFO_GATEWAY_INTERFACE:%{GATEWAY_INTERFACE}]
RewriteRule .* - [E=INFO_HTTPS:%{HTTPS}]
RewriteRule .* - [E=INFO_HTTP_ACCEPT:%{HTTP:Accept}]
RewriteRule .* - [E=INFO_HTTP_ACCEPT_LANGUAGE:%{HTTP:Accept-Language}]
RewriteRule .* - [E=INFO_HTTP_ACCEPT_ENCODING:%{HTTP:Accept-Encoding}]
RewriteRule .* - [E=INFO_HTTP_ACCEPT_CHARSET:%{HTTP:Accept-Charset}]
RewriteRule .* - [E=INFO_HTTP_CACHE_CONTROL:%{HTTP:Cache-Control}]
RewriteRule .* - [E=INFO_HTTP_CONNECTION:%{HTTP:Connection}]
RewriteRule .* - [E=INFO_HTTP_COOKIE:%{HTTP_COOKIE}]
RewriteRule .* - [E=INFO_HTTP_FORWARDED:%{HTTP_FORWARDED}]
RewriteRule .* - [E=INFO_HTTP_HOST:%{HTTP_HOST}]
RewriteRule .* - [E=INFO_HTTP_KEEP_ALIVE:%{HTTP_KEEP_ALIVE}]
RewriteRule .* - [E=INFO_HTTP_PROXY_CONNECTION:%{HTTP_PROXY_CONNECTION}]
RewriteRule .* - [E=INFO_HTTP_REFERER:%{HTTP:Referer}]
RewriteRule .* - [E=INFO_HTTP_USER_AGENT:%{HTTP_USER_AGENT}]
RewriteRule .* - [E=INFO_IS_SUBREQ:%{IS_SUBREQ}]
RewriteRule .* - [E=INFO_ORIG_PATH_INFO:%{ORIG_PATH_INFO}]
RewriteRule .* - [E=INFO_ORIG_PATH_TRANSLATED:%{ORIG_PATH_TRANSLATED}]
RewriteRule .* - [E=INFO_ORIG_SCRIPT_FILENAME:%{ORIG_SCRIPT_FILENAME}]
RewriteRule .* - [E=INFO_ORIG_SCRIPT_NAME:%{ORIG_SCRIPT_NAME}]
RewriteRule .* - [E=INFO_PATH:%{PATH}]
RewriteRule .* - [E=INFO_PATH_INFO:%{PATH_INFO}]
RewriteRule .* - [E=INFO_QUERY_STRING:%{QUERY_STRING}]
RewriteRule .* - [E=INFO_REDIRECT_QUERY_STRING:%{REDIRECT_QUERY_STRING}]
RewriteRule .* - [E=INFO_REDIRECT_REMOTE_USER:%{REDIRECT_REMOTE_USER}]
RewriteRule .* - [E=INFO_REDIRECT_STATUS:%{REDIRECT_STATUS}]
RewriteRule .* - [E=INFO_REDIRECT_URL:%{REDIRECT_URL}]
RewriteRule .* - [E=INFO_REMOTE_ADDR:%{REMOTE_ADDR}]
RewriteRule .* - [E=INFO_REMOTE_HOST:%{REMOTE_HOST}]
RewriteRule .* - [E=INFO_REMOTE_IDENT:%{REMOTE_IDENT}]
RewriteRule .* - [E=INFO_REMOTE_PORT:%{REMOTE_PORT}]
RewriteRule .* - [E=INFO_REMOTE_USER:%{REMOTE_USER}]
RewriteRule .* - [E=INFO_REQUEST_FILENAME:%{REQUEST_FILENAME}]
RewriteRule .* - [E=INFO_REQUEST_METHOD:%{REQUEST_METHOD}]
RewriteRule .* - [E=INFO_REQUEST_URI:%{REQUEST_URI}]
RewriteRule .* - [E=INFO_REDIRECT_REQUEST_URI:%{REDIRECT_REQUEST_URI}]
RewriteRule .* - [E=INFO_SCRIPT_FILENAME:%{SCRIPT_FILENAME}]
RewriteRule .* - [E=INFO_SCRIPT_GROUP:%{SCRIPT_GROUP}]
RewriteRule .* - [E=INFO_SCRIPT_NAME:%{SCRIPT_NAME}]
RewriteRule .* - [E=INFO_SCRIPT_URI:%{SCRIPT_URI}]
RewriteRule .* - [E=INFO_SCRIPT_URL:%{SCRIPT_URL}]
RewriteRule .* - [E=INFO_SCRIPT_USER:%{SCRIPT_USER}]
RewriteRule .* - [E=INFO_SERVER_ADDR:%{SERVER_ADDR}]
RewriteRule .* - [E=INFO_SERVER_ADMIN:%{SERVER_ADMIN}]
RewriteRule .* - [E=INFO_SERVER_NAME:%{SERVER_NAME}]
RewriteRule .* - [E=INFO_SERVER_PORT:%{SERVER_PORT}]
RewriteRule .* - [E=INFO_SERVER_PROTOCOL:%{SERVER_PROTOCOL}]
RewriteRule .* - [E=INFO_SERVER_SIGNATURE:%{SERVER_SIGNATURE}]
RewriteRule .* - [E=INFO_SERVER_SOFTWARE:%{SERVER_SOFTWARE}]
RewriteRule .* - [E=INFO_THE_REQUEST:%{THE_REQUEST}]
RewriteRule .* - [E=INFO_TIME:%{TIME}]
RewriteRule .* - [E=INFO_TIME_DAY:%{TIME_DAY}]
RewriteRule .* - [E=INFO_TIME_HOUR:%{TIME_HOUR}]
RewriteRule .* - [E=INFO_TIME_MIN:%{TIME_MIN}]
RewriteRule .* - [E=INFO_TIME_MON:%{TIME_MON}]
RewriteRule .* - [E=INFO_TIME_SEC:%{TIME_SEC}]
RewriteRule .* - [E=INFO_TIME_WDAY:%{TIME_WDAY}]
RewriteRule .* - [E=INFO_TIME_YEAR:%{TIME_YEAR}]
RewriteRule .* - [E=INFO_TZ:%{TZ}]
RewriteRule .* - [E=INFO_UNIQUE_ID:%{UNIQUE_ID}]
RequestHeader set INFO_API_VERSION "%{INFO_API_VERSION}e"
RequestHeader set INFO_AUTH_TYPE "%{INFO_AUTH_TYPE}e"
RequestHeader set INFO_CONTENT_LENGTH "%{INFO_CONTENT_LENGTH}e"
RequestHeader set INFO_CONTENT_TYPE "%{INFO_CONTENT_TYPE}e"
RequestHeader set INFO_DOCUMENT_ROOT "%{INFO_DOCUMENT_ROOT}e"
RequestHeader set INFO_GATEWAY_INTERFACE "%{INFO_GATEWAY_INTERFACE}e"
RequestHeader set INFO_HTTPS "%{INFO_HTTPS}e"
RequestHeader set INFO_HTTP_ACCEPT "%{INFO_HTTP_ACCEPT}e"
RequestHeader set INFO_HTTP_ACCEPT_LANGUAGE "%{INFO_HTTP_ACCEPT_LANGUAGE}e"
RequestHeader set INFO_HTTP_ACCEPT_ENCODING "%{INFO_HTTP_ACCEPT_ENCODING}e"
RequestHeader set INFO_HTTP_ACCEPT_CHARSET "%{INFO_HTTP_ACCEPT_CHARSET}e"
RequestHeader set INFO_HTTP_CACHE_CONTROL "%{INFO_HTTP_CACHE_CONTROL}e"
RequestHeader set INFO_HTTP_CONNECTION "%{INFO_HTTP_CONNECTION}e"
RequestHeader set INFO_HTTP_COOKIE "%{INFO_HTTP_COOKIE}e"
RequestHeader set INFO_HTTP_FORWARDED "%{INFO_HTTP_FORWARDED}e"
RequestHeader set INFO_HTTP_HOST "%{INFO_HTTP_HOST}e"
RequestHeader set INFO_HTTP_KEEP_ALIVE "%{INFO_HTTP_KEEP_ALIVE}e"
RequestHeader set INFO_HTTP_PROXY_CONNECTION "%{INFO_HTTP_PROXY_CONNECTION}e"
RequestHeader set INFO_HTTP_REFERER "%{INFO_HTTP_REFERER}e"
RequestHeader set INFO_HTTP_USER_AGENT "%{INFO_HTTP_USER_AGENT}e"
RequestHeader set INFO_IS_SUBREQ "%{INFO_IS_SUBREQ}e"
RequestHeader set INFO_ORIG_PATH_INFO "%{INFO_ORIG_PATH_INFO}e"
RequestHeader set INFO_ORIG_PATH_TRANSLATED "%{INFO_ORIG_PATH_TRANSLATED}e"
RequestHeader set INFO_ORIG_SCRIPT_FILENAME "%{INFO_ORIG_SCRIPT_FILENAME}e"
RequestHeader set INFO_ORIG_SCRIPT_NAME "%{INFO_ORIG_SCRIPT_NAME}e"
RequestHeader set INFO_PATH "%{INFO_PATH}e"
RequestHeader set INFO_PATH_INFO "%{INFO_PATH_INFO}e"
RequestHeader set INFO_QUERY_STRING "%{INFO_QUERY_STRING}e"
RequestHeader set INFO_REDIRECT_QUERY_STRING "%{INFO_REDIRECT_QUERY_STRING}e"
RequestHeader set INFO_REDIRECT_REMOTE_USER "%{INFO_REDIRECT_REMOTE_USER}e"
RequestHeader set INFO_REDIRECT_STATUS "%{INFO_REDIRECT_STATUS}e"
RequestHeader set INFO_REDIRECT_URL "%{INFO_REDIRECT_URL}e"
RequestHeader set INFO_REMOTE_ADDR "%{INFO_REMOTE_ADDR}e"
RequestHeader set INFO_REMOTE_HOST "%{INFO_REMOTE_HOST}e"
RequestHeader set INFO_REMOTE_IDENT "%{INFO_REMOTE_IDENT}e"
RequestHeader set INFO_REMOTE_PORT "%{INFO_REMOTE_PORT}e"
RequestHeader set INFO_REMOTE_USER "%{INFO_REMOTE_USER}e"
RequestHeader set INFO_REQUEST_FILENAME "%{INFO_REQUEST_FILENAME}e"
RequestHeader set INFO_REQUEST_METHOD "%{INFO_REQUEST_METHOD}e"
RequestHeader set INFO_REQUEST_URI "%{INFO_REQUEST_URI}e"
RequestHeader set INFO_REQUEST_URI "%{INFO_REQUEST_URI}e"
RequestHeader set INFO_SCRIPT_FILENAME "%{INFO_SCRIPT_FILENAME}e"
RequestHeader set INFO_SCRIPT_GROUP "%{INFO_SCRIPT_GROUP}e"
RequestHeader set INFO_SCRIPT_NAME "%{INFO_SCRIPT_NAME}e"
RequestHeader set INFO_SCRIPT_URI "%{INFO_SCRIPT_URI}e"
RequestHeader set INFO_SCRIPT_URL "%{INFO_SCRIPT_URL}e"
RequestHeader set INFO_SCRIPT_USER "%{INFO_SCRIPT_USER}e"
RequestHeader set INFO_SERVER_ADDR "%{INFO_SERVER_ADDR}e"
RequestHeader set INFO_SERVER_ADMIN "%{INFO_SERVER_ADMIN}e"
RequestHeader set INFO_SERVER_NAME "%{INFO_SERVER_NAME}e"
RequestHeader set INFO_SERVER_PORT "%{INFO_SERVER_PORT}e"
RequestHeader set INFO_SERVER_PROTOCOL "%{INFO_SERVER_PROTOCOL}e"
RequestHeader set INFO_SERVER_SIGNATURE "%{INFO_SERVER_SIGNATURE}e"
RequestHeader set INFO_SERVER_SOFTWARE "%{INFO_SERVER_SOFTWARE}e"
RequestHeader set INFO_THE_REQUEST "%{INFO_THE_REQUEST}e"
RequestHeader set INFO_TIME "%{INFO_TIME}e"
RequestHeader set INFO_TIME_DAY "%{INFO_TIME_DAY}e"
RequestHeader set INFO_TIME_HOUR "%{INFO_TIME_HOUR}e"
RequestHeader set INFO_TIME_MIN "%{INFO_TIME_MIN}e"
RequestHeader set INFO_TIME_MON "%{INFO_TIME_MON}e"
RequestHeader set INFO_TIME_SEC "%{INFO_TIME_SEC}e"
RequestHeader set INFO_TIME_WDAY "%{INFO_TIME_WDAY}e"
RequestHeader set INFO_TIME_YEAR "%{INFO_TIME_YEAR}e"
RequestHeader set INFO_TZ "%{INFO_TZ}e"
RequestHeader set INFO_UNIQUE_ID "%{INFO_UNIQUE_ID}e"
Options +ExecCGI +FollowSymLinks
Order Deny,Allow
Deny from All
Allow from 208.113.134.190 64.111.114.111 208.113.134.203 208.113.152.201 env=REDIRECT_STATUS
Satisfy Any
SecFilterEngine Off
### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#
#
# TZ: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
SetEnv TZ America/Indianapolis
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
SetEnv SERVER_ADMIN webmaster@askapache.com
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.0/mod/core.html#options
# for more information.
#
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
DirectoryIndex index.html index.php /index.php
#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
Action php5-cgi /bin/php.cgi
#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler php5-cgi .php .php .inc
Header unset Pragma
FileETag None
<filesMatch "\.(php)$">
SetHandler php5-cgi
</filesMatch>
#
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/html
#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of: On | Off | EMail
#
ServerSignature Off
##############################################
# HEADERS and CACHING #
##############################################
#Redirect 400 /e/400
#Redirect 401 /e/401
#Redirect 402 /e/402
#Redirect 403 /e/403
#Redirect 404 /e/404
#Redirect 405 /e/405
#Redirect 406 /e/406
#Redirect 407 /e/407
#Redirect 408 /e/408
#Redirect 409 /e/409
#Redirect 410 /e/410
#Redirect 411 /e/411
#Redirect 412 /e/412
#Redirect 413 /e/413
#Redirect 414 /e/414
#Redirect 415 /e/415
#Redirect 416 /e/416
#Redirect 417 /e/417
#Redirect 418 /e/418
#Redirect 419 /e/419
#Redirect 420 /e/420
#Redirect 421 /e/421
#Redirect 422 /e/422
#Redirect 423 /e/423
#Redirect 424 /e/424
#Redirect 425 /e/425
#Redirect 426 /e/426
#Redirect 500 /e/500
#Redirect 501 /e/501
#Redirect 502 /e/502
#Redirect 503 /e/503
#Redirect 504 /e/504
#Redirect 505 /e/505
#Redirect 506 /e/506
#Redirect 507 /e/507
#Redirect 508 /e/508
#Redirect 509 /e/509
#Redirect 510 /e/510
#
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
##############################################
# PERMANENT REDIRECTS #
##############################################
Redirect 301 /12-lessons-for-those-afraid-of-css.html http://www.askapache.com/css/12-lessons-for-those-afraid-of-css.html
Redirect 301 /2006/htaccess/htaccesselite-ultimate-htaccess-article.html http://www.askapache.com/htaccess/apache-htaccess.html
Redirect 301 /2007/phpbb/sending-post-form-data-with-php-curl.html http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html
Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.askapache.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.askapache.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
Redirect 301 /2007/webmaster/php-and-ajax-shell-console.html http://www.askapache.com/tools/php-and-ajax-shell-console.html
Redirect 301 /27-request-methods-for-use-with-apache-and-rewritecond-and-htaccess.html http://www.askapache.com/htaccess/27-request-methods-for-use-with-apache-and-rewritecond-and-htaccess.html
Redirect 301 /404-google-wordpress-plugin.html http://www.askapache.com/seo/404-google-wordpress-plugin.html
Redirect 301 /503-service-temporarily-unavailable.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /Overview-about.rdf http://www.askapache.com/askapache-home.rdf
Redirect 301 /abbr-acronym.html http://www.askapache.com/xhtml/abbr-acronym.html
Redirect 301 /adsense-robots.html http://www.askapache.com/google/adsense-robots.html
Redirect 301 /alexa-toolbar-firefox.html http://www.askapache.com/tools/alexa-toolbar-firefox.html
Redirect 301 /allowing-access-from-1-static-ip-and-deny-the-rest.html http://www.askapache.com/htaccess/apache-htaccess.html
Redirect 301 /anti-virus-spyware-rootkit.html http://www.askapache.com/security/anti-virus-spyware-rootkit.html
Redirect 301 /apache-ssl-in-htaccess-examples.html http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html
Redirect 301 /awk-tutorial.html http://www.askapache.com/awk/awk-tutorial.html
Redirect 301 /best-adsense-optimization.html http://www.askapache.com/wordpress/best-adsense-optimization.html
Redirect 301 /commonly-used-htaccess-code-examples.html http://www.askapache.com/htaccess/commonly-used-htaccess-code-examples.html
Redirect 301 /css-background-image-sprite.html http://www.askapache.com/css/css-background-image-sprite.html
Redirect 301 /css-browser-screenshots.html http://www.askapache.com/tools/css-browser-screenshots.html
Redirect 301 /css-class-example.html http://www.askapache.com/css/css-class-example.html
Redirect 301 /curl-multi-downloads.html http://www.askapache.com/php/curl-multi-downloads.html
Redirect 301 /custom-boot-menu-in-windows-xp.html http://www.askapache.com/windows/custom-boot-menu-in-windows-xp.html
Redirect 301 /donate http://www.dreamhost.com/donate.cgi?id=8261
Redirect 301 /donate/ http://www.dreamhost.com/donate.cgi?id=8261
Redirect 301 /htaccess.txt http://z.askapache.com/p/htaccess.txt
Redirect 301 /htaccess/404-errorpages.html http://www.askapache.com/seo/google-ajax-search-seo-tips.html
Redirect 301 /htaccess/feedsmith http://www.askapache.com/htaccess/feedsmith-htaccess.html
Redirect 301 /htaccess/http-status-codes.html http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html
Redirect 301 /htaccess/instruct-search-engines-to-come-back-to-site-after-you-finish-working-on-it.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /htaccess/speed-up-the-apache-web-server-with-configuration-hacks.html http://www.askapache.com/htaccess/apache-web-server-speed-configuration-hacks.html
Redirect 301 /instruct-search-engines-to-come-back-to-site-after-you-finish-working-on-it.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /security/bypassing-vlan.html http://www.askapache.com/security/hacking-vlan-switched-networks.html
Redirect 301 /security/bypassing-vlanbypassing-vlan.html http://www.askapache.com/security/hacking-vlan-switched-networks.html
Redirect 301 /security/rigging-the-dreamhost-site-of-the-month-contest.html http://www.askapache.com/dreamhost/rigging-the-dreamhost-site-of-the-month-contest.html
Redirect 301 /seo/tailrankcom-robot.html http://www.askapache.com/seo/tailrank-robot.html
Redirect 301 /webmaster/caching-tutorial-for-webmasters.html http://www.askapache.com/htaccess/caching-tutorial-for-webmasters.html
Redirect 301 /webmaster/lft-traceroute-tool.html http://www.askapache.com/tools/lft-traceroute-tool.html
##############################################
# PERMANENT REDIRECTMATCH #
##############################################
#RedirectMatch 301 ^/&(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/&(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/([^/]+)//$ http://www.askapache.com/$1/
RedirectMatch 301 ^/(.+)/htaccesselite-ultimate-htaccess-article.html(.*) http://www.askapache.com/htaccess/apache-htaccess.html
RedirectMatch 301 ^/(.+)\.html/([a-z][a-z])/$ http://www.askapache.com/$1.html
RedirectMatch 301 ^/([\(]+)(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/([^9]*)9O1X.3y(.*)/(.*)$ http://www.askapache.com/$2
RedirectMatch 301 ^/.3y(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/200([0-9])/([0-9])(.*)$ http://www.askapache.com/top-100/
RedirectMatch 301 ^/200([0-9])/([^01])(.*)$ http://www.askapache.com/$2$3
RedirectMatch 301 ^/about/glossary(.*)$ http://www.askapache.com/glossary$1
RedirectMatch 301 ^/apache-speed(.*)$ http://www.askapache.com/htaccess/apache-speed$1
RedirectMatch 301 ^/category/(.+)$ http://www.askapache.com/$1
RedirectMatch 301 ^/docs/(.*)$ http://askapache.info/$1
RedirectMatch 301 ^/htaccess/feedsmith-htaccess(.*) http://www.askapache.com/htaccess/redirecting-wordpress-feeds-to-feedburner.html
RedirectMatch 301 ^/robots-txt(.*)$ http://www.askapache.com/robots.txt
RedirectMatch 301 ^/hosting/?$ http://www.askapache.com/hosting/
#RedirectMatch 301 ^/wp-content/uploads/(.*)$ http://z.askapache.com/uploads/$1
#RedirectMatch 301 ^/z/(.+)$ http://z.askapache.com/$1
#RedirectMatch 301 ^/(z|t|i|j|c|p)/(.*)$ http://z.askapache.com/$1/$2
##############################################
# TEMPORARY REDIRECTMATCH #
##############################################
RedirectMatch 307 ^/getflash/?$ http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash
RedirectMatch 307 ^/dream/?$ http://www.askapache.com/dreamhost/
RedirectMatch 307 ^/(cse|apachecse|apachecsetest|apachesearch)/?$ http://www.google.com/coop/cse?cx=002660089121042511758%3Akk7rwc2gx0i
#
# Commonly used filename extensions to character sets. You probably
# want to avoid clashes with the language extensions, unless you
# are good at carefully testing your setup after each change.
# See http://www.iana.org/assignments/character-sets for the
# official list of charset names and their respective RFCs.
#
AddDefaultCharset UTF-8
#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
#
AddType 'application/rdf+xml; charset=UTF-8' .rdf
AddType 'application/xhtml+xml; charset=UTF-8' .xhtml
AddType 'application/xhtml+xml; charset=UTF-8' .xhtml.gz
AddType 'text/html; charset=UTF-8' .html
AddType 'text/html; charset=UTF-8' .html.gz
AddType application/octet-stream .rar .chm .bz2 .tgz .msi .pdf .exe
AddType application/vnd.ms-excel .csv
AddType application/x-httpd-php-source .phps
AddType application/x-pilot .prc .pdb
AddType application/x-shockwave-flash .swf
AddType application/xrds+xml .xrdf
AddType text/plain .ini .sh .bsh .bash .awk .nawk .gawk .csh .var .c .in .h .asc .md5 .sha .sha1
AddType video/x-flv .flv
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
# Despite the name similarity, the following Add* directives have nothing
# to do with the FancyIndexing customization directives above.
#
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
# # Customizable error responses come in three flavors: # 1) plain text 2) local redirects 3) external redirects #ErrorDocument 100 /X/E/1/HTTP_CONTINUE.html #ErrorDocument 101 /X/E/1/HTTP_SWITCHING_PROTOCOLS.html #ErrorDocument 102 /X/E/1/HTTP_PROCESSING.html #ErrorDocument 200 /X/E/2/HTTP_OK.html #ErrorDocument 201 /X/E/2/HTTP_CREATED.html #ErrorDocument 202 /X/E/2/HTTP_ACCEPTED.html #ErrorDocument 203 /X/E/2/HTTP_NON_AUTHORITATIVE.html #ErrorDocument 204 /X/E/2/HTTP_NO_CONTENT.html #ErrorDocument 205 /X/E/2/HTTP_RESET_CONTENT.html #ErrorDocument 206 /X/E/2/HTTP_PARTIAL_CONTENT.html #ErrorDocument 207 /X/E/2/HTTP_MULTI_STATUS.html #ErrorDocument 300 /X/E/HTTP_MULTIPLE_CHOICES.html #ErrorDocument 301 /X/E/HTTP_MOVED_PERMANENTLY.html #ErrorDocument 302 /X/E/HTTP_MOVED_TEMPORARILY.html #ErrorDocument 303 /X/E/HTTP_SEE_OTHER.html #ErrorDocument 304 /X/E/HTTP_NOT_MODIFIED.html #ErrorDocument 305 /X/E/HTTP_USE_PROXY.html #ErrorDocument 307 /X/E/HTTP_TEMPORARY_REDIRECT.html #ErrorDocument 404 /X/E/HTTP_NOT_FOUND.html ErrorDocument 400 /X/E/4/HTTP_BAD_REQUEST.html ErrorDocument 401 /X/E/4/HTTP_UNAUTHORIZED.html ErrorDocument 402 /X/E/4/HTTP_PAYMENT_REQUIRED.html ErrorDocument 403 /X/E/4/HTTP_FORBIDDEN.html ErrorDocument 405 /X/E/4/HTTP_METHOD_NOT_ALLOWED.html ErrorDocument 406 /X/E/4/HTTP_NOT_ACCEPTABLE.html ErrorDocument 407 /X/E/4/HTTP_PROXY_AUTHENTICATION_REQUIRED.html ErrorDocument 408 /X/E/4/HTTP_REQUEST_TIME_OUT.html ErrorDocument 409 /X/E/4/HTTP_CONFLICT.html ErrorDocument 410 /X/E/4/HTTP_GONE.html ErrorDocument 411 /X/E/4/HTTP_LENGTH_REQUIRED.html ErrorDocument 412 /X/E/4/HTTP_PRECONDITION_FAILED.html ErrorDocument 413 /X/E/4/HTTP_REQUEST_ENTITY_TOO_LARGE.html ErrorDocument 414 /X/E/4/HTTP_REQUEST_URI_TOO_LARGE.html ErrorDocument 415 /X/E/4/TTP_UNSUPPORTED_MEDIA_TYPE.html ErrorDocument 416 /X/E/4/HTTP_RANGE_NOT_SATISFIABLE.html ErrorDocument 417 /X/E/4/HTTP_EXPECTATION_FAILED.html ErrorDocument 422 /X/E/4/HTTP_UNPROCESSABLE_ENTITY.html ErrorDocument 423 /X/E/4/HTTP_LOCKED.html ErrorDocument 424 /X/E/4/HTTP_FAILED_DEPENDENCY.html ErrorDocument 426 /X/E/4/HTTP_UPGRADE_REQUIRED.html ErrorDocument 500 /X/E/5/HTTP_INTERNAL_SERVER_ERROR.html ErrorDocument 501 /X/E/5/HTTP_NOT_IMPLEMENTED.html ErrorDocument 502 /X/E/5/HTTP_BAD_GATEWAY.html ErrorDocument 503 /X/E/5/HTTP_SERVICE_UNAVAILABLE.html ErrorDocument 504 /X/E/5/HTTP_GATEWAY_TIME_OUT.html ErrorDocument 505 /X/E/5/HTTP_VERSION_NOT_SUPPORTED.html ErrorDocument 506 /X/E/5/HTTP_VARIANT_ALSO_VARIES.html ErrorDocument 507 /X/E/5/HTTP_INSUFFICIENT_STORAGE.html ErrorDocument 510 /X/E/5/HTTP_NOT_EXTENDED.html ErrorDocument 404 /index.php?error=404 # 1 YEAR <filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$"> Header unset P3P Header set Cache-Control "public" Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT" </filesMatch> # 2 HOURS <filesMatch "\.(html|htm|xml|txt|xsl)$"> <ifModule mod_expires.c> ExpiresActive On ExpiresDefault A3600 </ifModule> </filesMatch>
Oh ya, here are some GREAT Rewrites
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(stats/|missing\.html|failed_auth\.html|test/).* [NC,OR]
RewriteCond %{ENV:REDIRECT_STATUS} =200
RewriteRule .* - [L]
RewriteCond %{THE_REQUEST} ^GET\ /search/.*\ HTTP/ [NC]
RewriteCond %{QUERY_STRING} ^s=(.+)$ [NC]
RewriteRule .* http://www.askapache.com/search/%1? [R=302,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^error(/?[0-9]*)/?$ /X/error/$1/index.html [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/(y_key_bf61afd498f7623a\.html|google3bb7b7e1032ad0d4\.html|yadis\.xrdf|os-description\.xml|gnu-fdl\.txt|wlmmanifest\.xml|robots\.txt|w3c/|openid/|error/?|E/)(.*)$ [NC]
RewriteRule ^(.*)$ /X/%1%2 [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /X/(.*)\ HTTP/
RewriteRule .* - [F,NS,L]
#RewriteRule ^osq?(.*)$ /wp-content/plugins/wp-opensearch.php?$1 [QSA,L]
#RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /wp-login(.+)\ HTTP/ [NC]
#RewriteRule .+ https://www.askapache.com/wp-login%1 [R,L]
RewriteCond %{REQUEST_URI} ^/cgi-bin/(hash|java)\.cgi$ [NC]
RewriteCond %{HTTP:P3P} ^(([^:]+):(.+))$ [NC]
RewriteRule .* - [E=HTTP_JS:%{HTTP:P3P},E=HTTP_US:%2,E=HTTP_PA:%3]
RewriteCond %{HTTP_ACCEPT} application/xrds\+xml
RewriteCond %{HTTP_ACCEPT} !application/xrds\+xml\s*;\s*q\s*=\s*0(\.0{1,3})?\s*(,|$)
RewriteRule ^$ http://www.askapache.com/yadis.xrdf [R,L]
RewriteCond %{REQUEST_URI} ^/(search/|.+\.html)/feed/?$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*(FeedBurner|FeedValidator|talkr.com).*$ [NC,OR]
RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\.*$ [NC]
RewriteRule .* - [S=2]
RewriteCond %{REQUEST_URI} ^/.*(comments)/?$ [NC,OR]
RewriteCond %{REQUEST_FILENAME} .*/(wp-comments-post|wp-commentsrss2)\.php$ [NC,OR]
RewriteCond %{QUERY_STRING} ^.*withcomments.*$ [NC]
RewriteRule .* http://feeds.askapache.com/apache/htaccess/comments? [R=302,L,S=1]
RewriteCond %{REQUEST_URI} ^/.*(feed|rdf|rss|rss2|atom)/?$ [NC,OR]
RewriteCond %{REQUEST_FILENAME} .*/(wp-atom|wp-feed|wp-rdf|wp-rss|wp-rss2)\.php$ [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(feed|rdf|rss|rss2|atom).*$ [NC]
RewriteRule .* http://feeds.askapache.com/apache/htaccess? [R=302,L]
#RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(feed|rdf|rss|rss2|atom)/?.*\ HTTP/ [NC]
#RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(feed|rdf|rss|rss2|atom|wp-atom|wp-feed|wp-rdf|wp-rss|wp-rss2).*\ HTTP/ [NC]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.+)\.phps$ /cgi-bin/phps.php?file=$1.php [L,NC]
#RewriteCond %{HTTPS} !=on [NC]
#RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /wp-(login|admin)(.+)\ HTTP/ [NC]
#RewriteRule .+ https://www.askapache.com/wp-%1%2 [R,L]
SetEnvIf and Mod_Security
SetEnvIf Request_URI "^/(online-tools/js-compress/?|cgi-bin/search\.php|cgi-bin/java\.cgi|wp-admin/.*|test/)" MODSEC_ENABLE=Off
#SetEnvIfNoCase Remote_Addr ^208\.113\.134\.190$ MODSEC_ENABLE=Off
SecFilterEngine On
SecFilterCheckURLEncoding On
SecFilterCheckUnicodeEncoding Off
SecFilterScanPOST On
SecAuditEngine RelevantOnly
SecAuditLog /home/askapache/sites/askapache.com/logs/modsec_audit.log
SecFilterDebugLog /home/askapache/sites/askapache.com/logs/modsec_debug.log
SecFilterDebugLevel 1
SecAuditLogRelevantStatus "^(?:1|2(?!00)|5|4(?!04))"
SecFilterDefaultAction "deny,log,auditlog,severity:2,status:403"
SecFilterSelective REQUEST_URI "^/test/?" "severity:1,allow,log,auditlog"
#Enforce proper HTTP requests
SecFilterSelective SERVER_PROTOCOL "!^HTTP/(0\.9|1\.0|1\.1)$" "id:340000,rev:1,severity:1,msg:'Bad HTTP Protocol'"
# Only accept request encodings we know how to handle
SecFilterSelective REQUEST_METHOD "!^(GET|HEAD|POST)$" "chain,id:340001,rev:1,severity:2,msg:'Restricted HTTP function'"
SecFilterSelective HTTP_Content-Type "!(^$|^application/x-www-form-urlencoded$|^multipart/form-data)"
#Generic rule for allowed characters, adjust for your site before activating
#SecFilterSelective REQUEST_URI "!^[a-zA-Z0-9\.\+\_\/\-\?\=\&\%\#]+$" "chain,id:390002,rev:1,severity:2,msg:'Restricted HTTP character set'"
#SecFilterSelective REQUEST_URI "!^/(openid|wp-admin|wp-includes|wp-content|wp-login.php)"
# Require Content-Length to be provided with every POST request
SecFilterSelective REQUEST_METHOD "^POST$" "chain,id:340003,rev:1,severity:2,msg:'Content Length not provided with POST'"
SecFilterSelective HTTP_Content-Length "^$"
# Don't accept transfer encodings we know we don't handle
# (and you don't need it anyway)
SecFilterSelective HTTP_Transfer-Encoding "!^$" "id:340004,rev:1,severity:2,msg:'Dis-allowed Transfer Encoding'"
#HTTP response splitting generic sigs
SecFilter "Content-Length\:.*Content-Type\:.*Content-Type\:" "id:340005,rev:1,severity:2,msg:'HTTP response splitting'"
#HTTP response splitting generic sigs
SecFilter "Content-Length\:" "chain,id:340006,rev:1,severity:2,msg:'HTTP response splitting'"
SecFilter "Content-Type\:"
#catch smuggling attacks
SecFilter "^(GET|POST).*Host:.*^(GET|POST)" "id:300012,rev:1,severity:2,msg:'catch smuggling attacks'"
#XSS insertion into Content-Type
SecFilterSelective THE_REQUEST "Content-Type\:.*(<[[:space:]]*(script|about|applet|activex|chrome)*>.*(script|about|applet|activex|chrome)[[:space:]]*>|onmouseover=|javascript\:)" "id:300002,rev:1,severity:2,msg:'XSS attack in Content-type header'"
#Code injection via content length
SecFilterSelective HTTP_Content-Length "\;(system|passthru|exec)\(" "id:330003,rev:1,severity:2,msg:'Code Injection in Content-Length header'"
#Don't accept chunked encodings modsecurity can not look at these, so this is a hole that can bypass your rules, the rule before this one should cover this, but hey paranoia is cheap
SecFilterSelective HTTP_Transfer-Encoding "chunked" "id:300003,rev:1,severity:2,msg:'Chunked Transfer Encoding denied'"
##generic recursion signatures
SecFilterSelective REQUEST_URI "\.\./\.\./" "id:300004,rev:2,severity:2,msg:'Generic Path Recursion1 denied'"
SecFilterSelective THE_REQUEST "\.\|\./\.\|\./\.\|" "id:300005,rev:1,severity:2,msg:'Generic Path Recursion2 denied'"
SecFilterSelective THE_REQUEST "\.\.\./" "id:300006,rev:1,severity:2,msg:'Bogus Path denied'"
#Generic PHP exploit signatures
SecFilterSelective REQUEST_URI "<\?php (chr|fwrite|fopen|system|echr|passthru|popen|proc_open|shell_exec|exec|proc_nice|proc_terminate|proc_get_status|proc_close|pfsockopen|leak|apache_child_terminate|posix_kill|posix_mkfifo|posix_setpgid|posix_setsid|posix_setuid|phpinfo)\(.*\)\;" "id:330002,rev:1,severity:2,msg:'Generic PHP exploit pattern denied'"
#Prevent SQL injection in cookies
SecFilterSelective COOKIE_VALUES "((select|grant|delete|insert|drop|alter|replace|truncate|update|create|rename|describe)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]+[[:space:]]+(from|into|table|database|index|view)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]|UNION SELECT.*\'.*\'.*,[0-9].*INTO.*FROM)" "id:300011,rev:1,severity:2,msg:'Generic SQL injection in cookie'"
#Prevent SQL injection in UA
SecFilterSelective HTTP_USER_AGENT "((select|grant|delete|insert|drop|alter|replace|truncate|update|create|rename|describe)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]+[[:space:]]+(from|into|table|database|index|view)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]|UNION SELECT.*\'.*\'.*,[0-9].*INTO.*FROM)" "id:300012,rev:1,severity:2,msg:'Generic SQL injection in User Agent header'"
# Generic filter to prevent SQL injection attacks
# Understand that all SQL filters are very limited and are very difficult to prevent false postives and negatives.
# Please report false positives/negatives to mike@gotroot.com
SecFilter "((select|grant|delete|insert|drop|alter|replace|truncate|update|create|rename|describe)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]+[[:space:]]+(from|into|table|database|index|view)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]|UNION SELECT.*\'.*\'.*,[0-9].*INTO.*FROM)" "id:300013,rev:1,severity:2,msg:'Generic SQL injection protection'"
#generic XSS PHP attack types
SecFilterSelective REQUEST_URI "\.php\?" "chain,id:300010,rev:1,severity:2,msg:'Generic PHP XSS exploit pattern denied'"
SecFilter "(javascript\:/(.*new\x20ActiveXObject.*Sh\.regwrite|.*window\.opener\.document\.body.\innerHTML=window\.opener\.document\.body\.innerHTML\.replace)|onmouseover=\'javascript)"
#Generic XSS filter
#please report false positives
SecFilterSelective REQUEST_URI "!/mt\.cgi" "chain,msg:'XSS2'"
SecFilter "<[[:space:]]*(script|about|applet|activex|chrome)*>.*(script|about|applet|activex|chrome)[[:space:]]*>"
#XSS in referrer and UA headers
SecFilterSelective HTTP_REFERER|HTTP_USER_AGENT "<[[:space:]]*(script|about|applet|activex|chrome)*>.*(script|about|applet|activex|chrome)[[:space:]]*>" "msg:'XSS3'"
#HTTP header PHP code injection attacks
SecFilterSelective HTTP_CLIENT_IP|HTTP_USER_AGENT|HTTP_Referer "(<\?php|<[[:space:]]?\?[[:space:]]?php|<\? php)" "msg:'PHP1'"
#Generic PHP remote file injection
SecFilterSelective REQUEST_URI "!(/do_command)" "chain,msg:'PHP2'"
SecFilterSelective REQUEST_URI "\.php\?.*=(https?|ftp)\:/.*(cmd|command)="
#script, perl, etc. code in HTTP_Referer string
SecFilterSelective HTTP_Referer "\#\!.*/" "msg:'perl script1'"
#remote file inclusion generic attack signature
SecFilterSelective THE_REQUEST "\.(dat|gif|jpg|png|bmp|txt|vir|dot)\?" "chain,msg:'remote 1'"
SecFilter "((name|pm_path|pagina|path|include_location|root|page|open)=(http|https|ftp)|(cmd|command|inc)=)"
#remote file inclusion generic attack signature
SecFilterSelective THE_REQUEST "\.(dat|gif|jpg|png|bmp|txt|vir|dot)\?\&(cmd|command|inc|name)=" "msg:'remote2'"
#remote file inclusion generic attack signature
SecFilterSelective ARGS "\.(dat|gif|jpg|png|bmp|txt|vir|dot)" "chain,msg:'file inclusion1'"
SecFilter "\?\&(cmd|inc|name)="
#remote file inclusion generic attack signature
SecFilterSelective ARGS "\.(dat|gif|jpg|png|bmp|txt|vir|dot)\?\&(cmd|inc|name)=" "msg:'file inclusion2'"
#remote file inclusion generic attack signature
SecFilterSelective REQUEST_URI "\.php\?.*=(http|https|ftp)\:/.*\?&cmd=" "msg:'file inclusion3'"
#Bogus file extensions generic signature
SecFilterSelective THE_REQUEST "[A-Za-z0-9]\.(gif|jpg|png|bmp)\.txt" "msg:'file extension'"
#PHP remote path attach generic signature
SecFilterSelective REQUEST_URI "\.ph(p(3|4)?).*path=(http|https|ftp)\:/" "msg:'remote path1'"
SecFilterSelective REQUEST_URI "\.php.*path=(http|https|ftp)\:/" "msg:'remote path2'"
#generic php attack sigs
SecFilterSelective REQUEST_URI "(&(cmd|command)=(id|uname)\x20|cmd\?(cmd|command)=|(spy|cmd|cmd_out|sh)\.(gif|jpg|png|bmp|txt)\?&(cmd|command)=|\.php\?&(cmd|command)=)" "msg:'php attack1'"
# WEB-MISC apache directory disclosure attempt
SecFilterSelective THE_REQUEST "////////" "msg:'apache directory disclosure'"
#PHP defenses
SecFilterSelective ARG_PHPSESSID "!^$" "msg:'something in phpsessid'"
SecFilterSelective COOKIE_PHPSESSID "!^$" "msg:'something in cookie phpsessid'"
#PHP defenses
SecFilterSelective COOKIE_ASKAPACHEID "!^[0-9a-z]*$" "msg:'bad value for cookie'"
#cross site scripting attempt TYPE + JAVASCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]text\/javascript" "msg:'cross-site1'"
#cross site scripting attempt STYLE + JAVASCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]application\/x-javascript" "msg:'cross-site1'"
#cross site scripting attempt STYLE + JSCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]text\/jscript" "msg:'cross-site1'"
# cross site scripting attempt STYLE + VBSCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]text\/vbscript" "msg:'cross-site1'"
#cross site scripting attempt STYLE + VBSCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]application\/x-vbscript" "msg:'cross-site1'"
#cross site scripting attempt STYLE + ECMACRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]text\/ecmascript" "msg:'cross-site1'"
# cross site scripting attempt STYLE + EXPRESSION
SecFilterSelective THE_REQUEST "STYLE[\s]*=[\s]*[^>]expression[\s]*\(" "msg:'cross-site1'"
#cross site scripting attempt STYLE + EXPRESSION
SecFilterSelective THE_REQUEST "[\s]*expression[\s]*\([^}]}[\s]*<\/STYLE>" "msg:'cross-site1'"
# cross site scripting attempt using XML
SecFilterSelective THE_REQUEST "<!\[CDATA\[<\]\]>SCRIPT" "msg:'cross-site1'"
#cross site scripting attempt executing hidden Javascript
SecFilterSelective THE_REQUEST "eval[\s]*\([\s]*[^\.]\.innerHTML[\s]*\)" "msg:'cross-site1'"
#cross site scripting attempt executing hidden Javascript
SecFilterSelective THE_REQUEST "window\.execScript[\s]*\(" "msg:'cross-site1'"
#cross site scripting attempt to execute Javascript code
SecFilterSelective THE_REQUEST "/(((URL|SRC|HREF|LOWSRC)[\s]*=)|(url[\s]*[\(]))[\s]*[\'\"]*javascript[\:]" "msg:'cross-site1'"
#cross site scripting stealth attempt to execute Javascript code
#may false alarm for some language sets
SecFilterSelective REQUEST_URI "!(/index\.php\?module=Blocks&type=admin&func=update|/index\.php\?go=.*&edit=)" "chain,msg:'cross-site1'"
SecFilter "(((URL|SRC|HREF|LOWSRC)[\s]*=)|(url[\s]*[\(]))[\s]*[\'\"]*[\x09\x0a\x0b\x0c\x0d]*j[\x09\x0a\x0b\x0c\x0d]*a[\x09\x0a\x0b\x0c\x0d]*v[\x09\x0a\x0b\x0c\x0d]*a[\x09\x0a\x0b\x0c\x0d]*s[\x09\x0a\x0b\x0c\x0d]*c[\x09\x0a\x0b\x0c\x0d]*r[\x09\x0a\x0b\x0c\x0d]*i[\x09\x0a\x0b\x0c\x0d]*p[\x09\x0a\x0b\x0c\x0d]*t[\x09\x0a\x0b\x0c\x0d]*[\:]"
#cross site scripting HTML Image tag set to javascript attempt
SecFilterSelective THE_REQUEST "img src=javascript" "msg:'cross-site1'"
#Fake image file shell attacvk
SecFilterSelective HTTP_Content-Type "image/.*" "msg:'image shell 1'"
SecFilterSelective POST_PAYLOAD "chr\(" "msg:'image shell2'"
#bogus graphics file
SecFilterSelective HTTP_Content-Disposition "\.php" "chain,msg:'bogus graphics'"
SecFilterSelective HTTP_Content-Type "(image/gif|image/jpg|image/png|image/bmp)"
#---------------------------------------------
# reject keywords that appear in POST or GET
#=============================================
SecFilterSignatureAction "nolog,noauditlog,deny,severity:3,status:400"
<files wp-comments-post.php>
# fail for empty comment fields
SecFilterSelective "ARG_comment_post_ID" "^$" "id:50300,msg:'WORDPRESS SPAM MISSING comment_post_ID'"
SecFilterSelective "ARG_comment_post_ID" "!^[0-9]{1,6}$" "id:50301,msg:'WORDPRESS SPAM BAD comment_post_ID'"
#SecFilterSelective "comment_post_DI" "^$" "id:50310,msg:'WORDPRESS SPAM MISSING comment_post_DI'"
#SecFilterSelective "comment_post_DI" "!^[0-9]{1,2}$" "id:50311,msg:'WORDPRESS SPAM MISSING comment_post_DI'"
#SecFilterSelective "ARG_submit" "^Submit.Comment$" "msg:'bad submit comment value'"
</files>
SecFilterSelective ARGS "00bp\.com|360\.yahoo|987mb\.com|Ambien|American airline" "id:50010,msg:'SPAM 10'
SecFilterSelective ARGS "Ativan|Caresoprodol|Darvocet|Ephedra|Ephedrine" "id:50011,msg:'SPAM 11'
#SecFilterSelective ARGS "Gambling|Lexapro|Tramadol|Venlafaxine|\.info" "id:50012,msg:'SPAM 12'
SecFilterSelective ARGS "\[URL=|abgood|acura|acyclovir|adderall" "id:50013,msg:'SPAM 13'
SecFilterSelective ARGS "adipex|alcohol|alprazolam|amateur|amrit" "id:50014,msg:'SPAM 14'
SecFilterSelective ARGS "anal sex|analfinder|angelina jolie|asshole|axspace\.com" "id:50015,msg:'SPAM 15'
SecFilterSelective ARGS "baccarat|bankrupt|bikini|biotic|black jack" "id:50016,msg:'SPAM 16'
SecFilterSelective ARGS "blackjack|blog\.360|brutality|buddhism|butalbital" "id:50017,msg:'SPAM 17'
SecFilterSelective ARGS "cadillac|canalis|card credit|card stud|carisoprodol" "id:50018,msg:'SPAM 18'
SecFilterSelective ARGS "carmen|cash advance|cash credit|casino|catch\.com" "id:50019,msg:'SPAM 19'
SecFilterSelective ARGS "celebrex|celexa|cellulite|cheap|cheerleader" "id:50020,msg:'SPAM 20'
SecFilterSelective ARGS "chevrolet|child abuse|cialis|cigarette|cipro" "id:50021,msg:'SPAM 21'
SecFilterSelective ARGS "citroen|claritin|cleavage|clomid|codeine" "id:50022,msg:'SPAM 22'
SecFilterSelective ARGS "consulting23|craps online|credit card|credit debt|crestor" "id:50023,msg:'SPAM 23'
SecFilterSelective ARGS "dealership|debt free|desnudas|diazepam|dick" "id:50024,msg:'SPAM 24'
SecFilterSelective ARGS "dildo|drugstore|earrings|endometrioma|endowment" "id:50025,msg:'SPAM 25'
SecFilterSelective ARGS "erotic|estrogen|fioricet|francaise|freehost\.com" "id:50026,msg:'SPAM 26'
SecFilterSelective ARGS "freehostia|freemb\.com|fuck|geocities\.com|hacking myspace" "id:50027,msg:'SPAM 27'
SecFilterSelective ARGS "holdem|honda|hotels|hydrocodone|hypnotic" "id:50028,msg:'SPAM 28'
SecFilterSelective ARGS "hyundai|implants|incest|instant approval|insurance" "id:50029,msg:'SPAM 29'
SecFilterSelective ARGS "interracial|jaguar|jenny movie|johanson|kasino" "id:50030,msg:'SPAM 30'
SecFilterSelective ARGS "lesbian|levitra|lipitor|loan|lolita" "id:50031,msg:'SPAM 31'
SecFilterSelective ARGS "lorazepam|lorcet|lyrics|madamic|majorette" "id:50032,msg:'SPAM 32'
SecFilterSelective ARGS "malaria|mastercar|masturbate|masturbation|maturewomen" "id:50033,msg:'SPAM 33'
SecFilterSelective ARGS "mazda|medication|medicine|megsfree5\.com|mercedes" "id:50034,msg:'SPAM 34'
SecFilterSelective ARGS "meridia|metformin|mitsubishi|mortgage|myspace profile" "id:50035,msg:'SPAM 35'
SecFilterSelective ARGS "naked|neocool|nexium|nimire\.com|nissan" "id:50036,msg:'SPAM 36'
SecFilterSelective ARGS "nokia|nude|nudism|nymph|open toe" "id:50037,msg:'SPAM 37'
SecFilterSelective ARGS "oprodol|orgasm|oxycodone|oxycontin|packages" "id:50038,msg:'SPAM 38'
SecFilterSelective ARGS "painrelief|pantyhose|paxil|payday|penis" "id:50039,msg:'SPAM 39'
SecFilterSelective ARGS "percocet|pharmacy|phentermine|phetermine|phpbb_root" "id:50040,msg:'SPAM 40'
SecFilterSelective ARGS "pictaboo|pictorial|pills|pissing|play craps" "id:50041,msg:'SPAM 41'
SecFilterSelective ARGS "playgirl|pocker web|poker|pontiac|poquer" "id:50042,msg:'SPAM 42'
SecFilterSelective ARGS "porn|pounder|prescription|preteen|prevacid" "id:50043,msg:'SPAM 43'
SecFilterSelective ARGS "price1|prilosec|propecia|proza|prozac" "id:50044,msg:'SPAM 44'
SecFilterSelective ARGS "puddled|pussy|refinance|rentals|replica" "id:50045,msg:'SPAM 45'
SecFilterSelective ARGS "ringtones|roulette|screensaver|seduced|sexual" "id:50046,msg:'SPAM 46'
SecFilterSelective ARGS "sexy|shemale|shiloh|singulair|site-host" "id:50047,msg:'SPAM 47'
SecFilterSelective ARGS "slot machine|slot maschine|slots machine|solpip\.com|soma" "id:50048,msg:'SPAM 48'
SecFilterSelective ARGS "sperm|starlets|supplier|suzuki|tadalafil" "id:50049,msg:'SPAM 49'
SecFilterSelective ARGS "toyota|tylenol|ultram|valium|viagra" "id:50050,msg:'SPAM 50'
SecFilterSelective ARGS "vigora|vioxx|wallpaper|warez|webcam" "id:50051,msg:'SPAM 51'
SecFilterSelective ARGS "webpages\.com|wellbutrin|whitesluts|wholesale|whore" "id:50052,msg:'SPAM 52'
SecFilterSelective ARGS "windshield|xanax|xenical|y lohan|yourgirls" "id:50053,msg:'SPAM 53'
SecFilterSelective ARGS "youtube\.com|zantac|sex offenders|hotgay|Zoloft|celtic women" "id:50054,msg:'SPAM 54'
SecFilterSelective ARGS "dollhouse|freehot|kardashian|oralsex" "id:50055,msg:'SPAM 54'
# +ASKAPACHE PASSPRO 4.5.2
#######################################################
# __ __
# ____ ______/ /______ _____ ____ ______/ /_ ___
# / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__ ) ,< / /_/ / /_/ / /_/ / /__/ / / / __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
# /_/
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
# +APRO SIDS
# +SID 20030001
<files wp-login.php>
Order Deny,Allow
Deny from All
Satisfy Any
AuthType Digest
AuthName "Protected By AskApache"
AuthDigestDomain / http://www.askapache.com/
AuthDigestFile /home/.greer/askapache/sites/askapache.com/.htpasswda3
Require valid-user
</files>
# -SID 20030001
# -APRO SIDS
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
# __ __
# ____ ______/ /______ _____ ____ ______/ /_ ___
# / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__ ) ,< / /_/ / /_/ / /_/ / /__/ / / / __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
# /_/
#######################################################
# -ASKAPACHE PASSPRO 4.5.2
# +ASKAPACHE CRAZYCACHE 2.1
#######################################################
# __ __
# ____ ______/ /______ _____ ____ ______/ /_ ___
# / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__ ) ,< / /_/ / /_/ / /_/ / /__/ / / / __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
# /_/
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
# +ACACHE RULES
# +RULE root
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.+)\.rdf\ HTTP/ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/%1.html/index.rdf -f
RewriteRule .+ /wp-content/cache/aa/%1.html/index.rdf [L]
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD) [OR]
RewriteCond %{THE_REQUEST} ^$ [OR]
RewriteCond %{QUERY_STRING} nocache [OR]
RewriteCond %{HTTP_COOKIE} ^.*(comment|author|0460e109825fa411b361cd5cafa8bf8b).*$ [NC]
RewriteRule ^.*$ - [S=5]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa%{REQUEST_URI} !-d
RewriteRule .+ - [S=4]
RewriteCond %{HTTP:Accept} application/xhtml\+xml [NC,OR]
RewriteCond %{HTTP_USER_AGENT} .*W3C_Validator.* [NC]
RewriteRule .+ - [E=AA_CACHE_XHTML:x]
RewriteCond %{HTTP:Accept-Encoding} gzip [NC]
RewriteRule .+ - [E=AA_CACHE_GZIP:.gz]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa%{REQUEST_URI}/index.%{ENV:AA_CACHE_XHTML}html%{ENV:AA_CACHE_GZIP} -f
RewriteRule .+ /wp-content/cache/aa%{REQUEST_URI}/index.%{ENV:AA_CACHE_XHTML}html%{ENV:AA_CACHE_GZIP} [L]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa%{REQUEST_URI}/index.html%{ENV:AA_CACHE_GZIP} -f
RewriteRule .+ /wp-content/cache/aa%{REQUEST_URI}/index.html%{ENV:AA_CACHE_GZIP} [L]
# -RULE root
# -ACACHE RULES
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
# __ __
# ____ ______/ /______ _____ ____ ______/ /_ ___
# / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__ ) ,< / /_/ / /_/ / /_/ / /__/ / / / __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
# /_/
#######################################################
# -ASKAPACHE CRAZYCACHE 2.1
# BEGIN WordPress
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</ifModule>
# END WordPress
Options +FollowSymLinks
DirectoryIndex /test/index.php
AuthType Digest
AuthName "AskApache Pro"
AuthDigestFile /home/askapache/sites/askapache.com/.htpasswd-pro
AuthDigestDomain / http://www.askapache.com/test/ https://www.askapache.com/test/
Require user askapache
SetEnv MODSEC_ENABLE=Off
ErrorDocument 100 /test/index.php?e=100
ErrorDocument 101 /test/index.php?e=101
ErrorDocument 102 /test/index.php?e=102
ErrorDocument 200 /test/index.php?e=200
ErrorDocument 201 /test/index.php?e=201
ErrorDocument 202 /test/index.php?e=202
ErrorDocument 203 /test/index.php?e=203
ErrorDocument 204 /test/index.php?e=204
ErrorDocument 205 /test/index.php?e=205
ErrorDocument 206 /test/index.php?e=206
ErrorDocument 207 /test/index.php?e=207
ErrorDocument 300 /test/index.php?e=300
ErrorDocument 301 /test/index.php?e=301
ErrorDocument 302 /test/index.php?e=302
ErrorDocument 303 /test/index.php?e=303
ErrorDocument 304 /test/index.php?e=304
ErrorDocument 305 /test/index.php?e=305
ErrorDocument 306 /test/index.php?e=306
ErrorDocument 307 /test/index.php?e=307
ErrorDocument 400 /test/index.php?e=400
ErrorDocument 401 /test/index.php?e=401
ErrorDocument 402 /test/index.php?e=402
ErrorDocument 403 /test/index.php?e=403
ErrorDocument 404 /test/index.php?e=404
ErrorDocument 405 /test/index.php?e=405
ErrorDocument 406 /test/index.php?e=406
ErrorDocument 407 /test/index.php?e=407
ErrorDocument 408 /test/index.php?e=408
ErrorDocument 409 /test/index.php?e=409
ErrorDocument 410 /test/index.php?e=410
ErrorDocument 411 /test/index.php?e=411
ErrorDocument 412 /test/index.php?e=412
ErrorDocument 413 /test/index.php?e=413
ErrorDocument 414 /test/index.php?e=414
ErrorDocument 415 /test/index.php?e=415
ErrorDocument 416 /test/index.php?e=416
ErrorDocument 417 /test/index.php?e=417
ErrorDocument 418 /test/index.php?e=418
ErrorDocument 419 /test/index.php?e=419
ErrorDocument 420 /test/index.php?e=420
ErrorDocument 421 /test/index.php?e=421
ErrorDocument 422 /test/index.php?e=422
ErrorDocument 423 /test/index.php?e=423
ErrorDocument 424 /test/index.php?e=424
ErrorDocument 425 /test/index.php?e=425
ErrorDocument 426 /test/index.php?e=426
ErrorDocument 500 /test/index.php?e=500
ErrorDocument 501 /test/index.php?e=501
ErrorDocument 502 /test/index.php?e=502
ErrorDocument 503 /test/index.php?e=503
ErrorDocument 504 /test/index.php?e=504
ErrorDocument 505 /test/index.php?e=505
ErrorDocument 506 /test/index.php?e=506
ErrorDocument 507 /test/index.php?e=507
ErrorDocument 508 /test/index.php?e=508
ErrorDocument 509 /test/index.php?e=509
ErrorDocument 510 /test/index.php?e=510
Redirect 404 /test/error/404
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /test/error/404 [L]
RewriteRule .* - [E=MODSEC_ENABLE:Off,E=INFO_API_VERSION:%{API_VERSION},NE]
RewriteRule .* - [E=INFO_AUTH_TYPE:%{AUTH_TYPE},NE]
RewriteRule .* - [E=INFO_CONTENT_LENGTH:%{CONTENT_LENGTH},NE]
RewriteRule .* - [E=INFO_CONTENT_TYPE:%{CONTENT_TYPE},NE]
RewriteRule .* - [E=INFO_DOCUMENT_ROOT:%{DOCUMENT_ROOT},NE]
RewriteRule .* - [E=INFO_GATEWAY_INTERFACE:%{GATEWAY_INTERFACE},NE]
RewriteRule .* - [E=INFO_HTTPS:%{HTTPS},NE]
RewriteRule .* - [E=INFO_HTTP_ACCEPT:%{HTTP_ACCEPT},NE]
RewriteRule .* - [E=INFO_HTTP_ACCEPT_CHARSET:%{HTTP_ACCEPT_CHARSET},NE]
RewriteRule .* - [E=INFO_HTTP_ACCEPT_ENCODING:%{HTTP_ACCEPT_ENCODING},NE]
RewriteRule .* - [E=INFO_HTTP_ACCEPT_LANGUAGE:%{HTTP_ACCEPT_LANGUAGE},NE]
RewriteRule .* - [E=INFO_HTTP_CACHE_CONTROL:%{HTTP_CACHE_CONTROL},NE]
RewriteRule .* - [E=INFO_HTTP_CONNECTION:%{HTTP_CONNECTION},NE]
RewriteRule .* - [E=INFO_HTTP_COOKIE:%{HTTP_COOKIE},NE]
RewriteRule .* - [E=INFO_HTTP_FORWARDED:%{HTTP_FORWARDED},NE]
RewriteRule .* - [E=INFO_HTTP_HOST:%{HTTP_HOST},NE]
RewriteRule .* - [E=INFO_HTTP_KEEP_ALIVE:%{HTTP_KEEP_ALIVE},NE]
RewriteRule .* - [E=INFO_HTTP_MOD_SECURITY_MESSAGE:%{HTTP_MOD_SECURITY_MESSAGE},NE]
RewriteRule .* - [E=INFO_HTTP_PROXY_CONNECTION:%{HTTP_PROXY_CONNECTION},NE]
RewriteRule .* - [E=INFO_HTTP_REFERER:%{HTTP_REFERER},NE]
RewriteRule .* - [E=INFO_HTTP_USER_AGENT:%{HTTP_USER_AGENT},NE]
RewriteRule .* - [E=INFO_IS_SUBREQ:%{IS_SUBREQ},NE]
RewriteRule .* - [E=INFO_ORIG_PATH_INFO:%{ORIG_PATH_INFO},NE]
RewriteRule .* - [E=INFO_ORIG_PATH_TRANSLATED:%{ORIG_PATH_TRANSLATED},NE]
RewriteRule .* - [E=INFO_ORIG_SCRIPT_FILENAME:%{ORIG_SCRIPT_FILENAME},NE]
RewriteRule .* - [E=INFO_ORIG_SCRIPT_NAME:%{ORIG_SCRIPT_NAME},NE]
RewriteRule .* - [E=INFO_PATH:%{PATH},NE]
RewriteRule .* - [E=INFO_PATH_INFO:%{PATH_INFO},NE]
RewriteRule .* - [E=INFO_PHP_SELF:%{PHP_SELF},NE]
RewriteRule .* - [E=INFO_QUERY_STRING:%{QUERY_STRING},NE]
RewriteRule .* - [E=INFO_REDIRECT_QUERY_STRING:%{REDIRECT_QUERY_STRING},NE]
RewriteRule .* - [E=INFO_REDIRECT_REMOTE_USER:%{REDIRECT_REMOTE_USER},NE]
RewriteRule .* - [E=INFO_REDIRECT_STATUS:%{REDIRECT_STATUS},NE]
RewriteRule .* - [E=INFO_REDIRECT_URL:%{REDIRECT_URL},NE]
RewriteRule .* - [E=INFO_REMOTE_ADDR:%{REMOTE_ADDR},NE]
RewriteRule .* - [E=INFO_REMOTE_HOST:%{REMOTE_HOST},NE]
RewriteRule .* - [E=INFO_REMOTE_IDENT:%{REMOTE_IDENT},NE]
RewriteRule .* - [E=INFO_REMOTE_PORT:%{REMOTE_PORT},NE]
RewriteRule .* - [E=INFO_REMOTE_USER:%{REMOTE_USER},NE]
RewriteRule .* - [E=INFO_REQUEST_FILENAME:%{REQUEST_FILENAME},NE]
RewriteRule .* - [E=INFO_REQUEST_METHOD:%{REQUEST_METHOD},NE]
RewriteRule .* - [E=INFO_REQUEST_TIME:%{REQUEST_TIME},NE]
RewriteRule .* - [E=INFO_REQUEST_URI:%{REQUEST_URI},NE]
RewriteRule .* - [E=INFO_SCRIPT_FILENAME:%{SCRIPT_FILENAME},NE]
RewriteRule .* - [E=INFO_SCRIPT_GROUP:%{SCRIPT_GROUP},NE]
RewriteRule .* - [E=INFO_SCRIPT_NAME:%{SCRIPT_NAME},NE]
RewriteRule .* - [E=INFO_SCRIPT_URI:%{SCRIPT_URI},NE]
RewriteRule .* - [E=INFO_SCRIPT_URL:%{SCRIPT_URL},NE]
RewriteRule .* - [E=INFO_SCRIPT_USER:%{SCRIPT_USER},NE]
RewriteRule .* - [E=INFO_SERVER_ADDR:%{SERVER_ADDR},NE]
RewriteRule .* - [E=INFO_SERVER_ADMIN:%{SERVER_ADMIN},NE]
RewriteRule .* - [E=INFO_SERVER_NAME:%{SERVER_NAME},NE]
RewriteRule .* - [E=INFO_SERVER_PORT:%{SERVER_PORT},NE]
RewriteRule .* - [E=INFO_SERVER_PROTOCOL:%{SERVER_PROTOCOL},NE]
RewriteRule .* - [E=INFO_SERVER_SIGNATURE:%{SERVER_SIGNATURE},NE]
RewriteRule .* - [E=INFO_SERVER_SOFTWARE:%{SERVER_SOFTWARE},NE]
RewriteRule .* - [E=INFO_THE_REQUEST:%{THE_REQUEST},NE]
RewriteRule .* - [E=INFO_TIME:%{TIME},NE]
RewriteRule .* - [E=INFO_TIME_DAY:%{TIME_DAY},NE]
RewriteRule .* - [E=INFO_TIME_HOUR:%{TIME_HOUR},NE]
RewriteRule .* - [E=INFO_TIME_MIN:%{TIME_MIN},NE]
RewriteRule .* - [E=INFO_TIME_MON:%{TIME_MON},NE]
RewriteRule .* - [E=INFO_TIME_SEC:%{TIME_SEC},NE]
RewriteRule .* - [E=INFO_TIME_WDAY:%{TIME_WDAY},NE]
RewriteRule .* - [E=INFO_TIME_YEAR:%{TIME_YEAR},NE]
RewriteRule .* - [E=INFO_TZ:%{TZ},NE]
RewriteRule .* - [E=INFO_UNIQUE_ID:%{UNIQUE_ID},NE]
RequestHeader set INFO_API_VERSION "%{INFO_API_VERSION}e"
RequestHeader set INFO_AUTH_TYPE "%{INFO_AUTH_TYPE}e"
RequestHeader set INFO_CONTENT_LENGTH "%{INFO_CONTENT_LENGTH}e"
RequestHeader set INFO_CONTENT_TYPE "%{INFO_CONTENT_TYPE}e"
RequestHeader set INFO_DOCUMENT_ROOT "%{INFO_DOCUMENT_ROOT}e"
RequestHeader set INFO_GATEWAY_INTERFACE "%{INFO_GATEWAY_INTERFACE}e"
RequestHeader set INFO_HTTPS "%{INFO_HTTPS}e"
RequestHeader set INFO_HTTP_ACCEPT "%{INFO_HTTP_ACCEPT}e"
RequestHeader set INFO_HTTP_ACCEPT_CHARSET "%{INFO_HTTP_ACCEPT_CHARSET}e"
RequestHeader set INFO_HTTP_ACCEPT_ENCODING "%{INFO_HTTP_ACCEPT_ENCODING}e"
RequestHeader set INFO_HTTP_ACCEPT_LANGUAGE "%{INFO_HTTP_ACCEPT_LANGUAGE}e"
RequestHeader set INFO_HTTP_CACHE_CONTROL "%{INFO_HTTP_CACHE_CONTROL}e"
RequestHeader set INFO_HTTP_CONNECTION "%{INFO_HTTP_CONNECTION}e"
RequestHeader set INFO_HTTP_COOKIE "%{INFO_HTTP_COOKIE}e"
RequestHeader set INFO_HTTP_FORWARDED "%{INFO_HTTP_FORWARDED}e"
RequestHeader set INFO_HTTP_HOST "%{INFO_HTTP_HOST}e"
RequestHeader set INFO_HTTP_KEEP_ALIVE "%{INFO_HTTP_KEEP_ALIVE}e"
RequestHeader set INFO_HTTP_MOD_SECURITY_MESSAGE "%{INFO_HTTP_MOD_SECURITY_MESSAGE}e"
RequestHeader set INFO_HTTP_PROXY_CONNECTION "%{INFO_HTTP_PROXY_CONNECTION}e"
RequestHeader set INFO_HTTP_REFERER "%{INFO_HTTP_REFERER}e"
RequestHeader set INFO_HTTP_USER_AGENT "%{INFO_HTTP_USER_AGENT}e"
RequestHeader set INFO_IS_SUBREQ "%{INFO_IS_SUBREQ}e"
RequestHeader set INFO_ORIG_PATH_INFO "%{INFO_ORIG_PATH_INFO}e"
RequestHeader set INFO_ORIG_PATH_TRANSLATED "%{INFO_ORIG_PATH_TRANSLATED}e"
RequestHeader set INFO_ORIG_SCRIPT_FILENAME "%{INFO_ORIG_SCRIPT_FILENAME}e"
RequestHeader set INFO_ORIG_SCRIPT_NAME "%{INFO_ORIG_SCRIPT_NAME}e"
RequestHeader set INFO_PATH "%{INFO_PATH}e"
RequestHeader set INFO_PATH_INFO "%{INFO_PATH_INFO}e"
RequestHeader set INFO_PHP_SELF "%{INFO_PHP_SELF}e"
RequestHeader set INFO_QUERY_STRING "%{INFO_QUERY_STRING}e"
RequestHeader set INFO_REDIRECT_QUERY_STRING "%{INFO_REDIRECT_QUERY_STRING}e"
RequestHeader set INFO_REDIRECT_REMOTE_USER "%{INFO_REDIRECT_REMOTE_USER}e"
RequestHeader set INFO_REDIRECT_STATUS "%{INFO_REDIRECT_STATUS}e"
RequestHeader set INFO_REDIRECT_URL "%{INFO_REDIRECT_URL}e"
RequestHeader set INFO_REMOTE_ADDR "%{INFO_REMOTE_ADDR}e"
RequestHeader set INFO_REMOTE_HOST "%{INFO_REMOTE_HOST}e"
RequestHeader set INFO_REMOTE_IDENT "%{INFO_REMOTE_IDENT}e"
RequestHeader set INFO_REMOTE_PORT "%{INFO_REMOTE_PORT}e"
RequestHeader set INFO_REMOTE_USER "%{INFO_REMOTE_USER}e"
RequestHeader set INFO_REQUEST_FILENAME "%{INFO_REQUEST_FILENAME}e"
RequestHeader set INFO_REQUEST_METHOD "%{INFO_REQUEST_METHOD}e"
RequestHeader set INFO_REQUEST_TIME "%{INFO_REQUEST_TIME}e"
RequestHeader set INFO_REQUEST_URI "%{INFO_REQUEST_URI}e"
RequestHeader set INFO_SCRIPT_FILENAME "%{INFO_SCRIPT_FILENAME}e"
RequestHeader set INFO_SCRIPT_GROUP "%{INFO_SCRIPT_GROUP}e"
RequestHeader set INFO_SCRIPT_NAME "%{INFO_SCRIPT_NAME}e"
RequestHeader set INFO_SCRIPT_URI "%{INFO_SCRIPT_URI}e"
RequestHeader set INFO_SCRIPT_URL "%{INFO_SCRIPT_URL}e"
RequestHeader set INFO_SCRIPT_USER "%{INFO_SCRIPT_USER}e"
RequestHeader set INFO_SERVER_ADDR "%{INFO_SERVER_ADDR}e"
RequestHeader set INFO_SERVER_ADMIN "%{INFO_SERVER_ADMIN}e"
RequestHeader set INFO_SERVER_NAME "%{INFO_SERVER_NAME}e"
RequestHeader set INFO_SERVER_PORT "%{INFO_SERVER_PORT}e"
RequestHeader set INFO_SERVER_PROTOCOL "%{INFO_SERVER_PROTOCOL}e"
RequestHeader set INFO_SERVER_SIGNATURE "%{INFO_SERVER_SIGNATURE}e"
RequestHeader set INFO_SERVER_SOFTWARE "%{INFO_SERVER_SOFTWARE}e"
RequestHeader set INFO_THE_REQUEST "%{INFO_THE_REQUEST}e"
RequestHeader set INFO_TIME "%{INFO_TIME}e"
RequestHeader set INFO_TIME_DAY "%{INFO_TIME_DAY}e"
RequestHeader set INFO_TIME_HOUR "%{INFO_TIME_HOUR}e"
RequestHeader set INFO_TIME_MIN "%{INFO_TIME_MIN}e"
RequestHeader set INFO_TIME_MON "%{INFO_TIME_MON}e"
RequestHeader set INFO_TIME_SEC "%{INFO_TIME_SEC}e"
RequestHeader set INFO_TIME_WDAY "%{INFO_TIME_WDAY}e"
RequestHeader set INFO_TIME_YEAR "%{INFO_TIME_YEAR}e"
RequestHeader set INFO_TZ "%{INFO_TZ}e"
RequestHeader set INFO_UNIQUE_ID "%{INFO_UNIQUE_ID}e"
#SetEnvIfNoCase ^WWW-Auth "(.*)" HTTP_MYHEADER=$1
#Header set WWW-Authenticate "Allow"
#SetEnvIf Remote_Addr 208\.113\.134\.190$ MODSEC_ENABLE=Off
#SetEnvIf Server_Addr ^$ MODSEC_ENABLE=Off
#SetEnvIf Remote_Addr ^({SERVER_ADDR}e)$ GOOD=$1
#SetEnvIf Server_Addr GOOD R
#SetEnvIfNoCase ^Cookie$ "(.*)" HTTP_MY_COOKIE=$1
#
#ExpiresActive Off
#FileETag None
#Header unset Connection
#Header set Connection "close"
#Header unset Last-Modified
#Header unset ETag
#Header unset Accept-Ranges
#Header unset Vary
#Header unset Content-Type
#Header unset X-Pingback
#Header unset P3P
#Header add RouterBits "%D %t"
#Header add Location "http://www.askapache.com/feed/"
#Header add Found "http://askapache.com/feed/"
#Header add Content-Location "http://www.askapache.com/feed/"
#Header add Refresh "http://www.askapache.com/feed/"
#SetEnvIfNoCase ^User-Agent$ "(.+)" HTTP_IF_MODIFIED_SINCE=$1
#SetEnvIfNoCase ^If-None-Match$ "(.+)" HTTP_IF_NONE_MATCH=$1
#SetEnvIfNoCase ^Cache-Control$ "(.+)" HTTP_CACHE_CONTROL=$1
#SetEnvIfNoCase ^Connection$ "(.+)" HTTP_CONNECTION=$1
#SetEnvIfNoCase ^Keep-Alive$ "(.+)" HTTP_KEEP_ALIVE=$1
#SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
#SetEnvIfNoCase ^Cookie$ "(.+)" HTTP_MY_COOKIE=$1
#SetEnvIfNoCase Remote_Addr "(.*)" HTTP_MY_REMOTE_ADDR=$1
#Header set Hi "%{INFO_HTTP_MY_REMOTE_ADDR}e"
#SetEnvIfNoCase ^User-Agent$ "(.*)" HTTP_MY_CACHE_CONTROL=$1
#SetEnvIfNoCase ^User-Agent$ "(.*)" MY_CACHE_CONTROL=$1
#SetEnvIfNoCase ^User-Agent$ "(.*)" MY_USER_AGENT=$1
#SetEnvIfNoCase Remote_Host "(.*)" HTTP_MY_REMOTE_HOST=$1
#SetEnvIfNoCase Remote_Addr "(.*)" HTTP_MY_REMOTE_ADDR=$1
#SetEnvIfNoCase Server_Addr "(.*)" HTTP_MY_SERVER_ADDR=$1
#SetEnvIfNoCase Request_Method "(.*)" HTTP_MY_REQUEST_METHOD=$1
#SetEnvIfNoCase Request_Protocol "(.*)" HTTP_MY_REQUEST_PROTOCOL=$1
#SetEnvIfNoCase Request_URI "(.*)" HTTP_MY_REQUEST_URI=$1
#RequestHeader set Cache-Control "%{INFO_HTTP_MY_CACHE_CONTROL}e"
Options +ExecCGI
<filesMatch "\.(cgi|ini)$">
Order Deny,Allow
Deny from All
Allow from 208.113.134.190 64.111.114.111 208.113.134.203 208.113.152.201 env=REDIRECT_STATUS
Satisfy Any
</filesMatch>### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#
#
# TZ: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
SetEnv TZ America/Indianapolis
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
SetEnv SERVER_ADMIN webmaster@askapache.com
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.0/mod/core.html#options
# for more information.
#
Options +FollowSymLinks -ExecCGI -Indexes -Includes -MultiViews
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
DirectoryIndex index.html index.php /index.php
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<filesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</filesMatch>
#
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/html
#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of: On | Off | EMail
#
ServerSignature Off
##############################################
# HEADERS and CACHING #
##############################################
Header unset Pragma
FileETag None
#
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Example:
# Redirect permanent /foo http://www.example.com/bar
#
# Commonly used filename extensions to character sets. You probably
# want to avoid clashes with the language extensions, unless you
# are good at carefully testing your setup after each change.
# See http://www.iana.org/assignments/character-sets for the
# official list of charset names and their respective RFCs.
#
AddDefaultCharset UTF-8
#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
#
AddType 'application/rdf+xml; charset=UTF-8' .rdf
AddType 'application/xhtml+xml; charset=UTF-8' .xhtml
AddType 'application/xhtml+xml; charset=UTF-8' .xhtml.gz
AddType 'text/html; charset=UTF-8' .html
AddType 'text/html; charset=UTF-8' .html.gz
AddType application/octet-stream .rar .chm .bz2 .tgz .msi .pdf .exe
AddType application/vnd.ms-excel .csv
AddType application/x-httpd-php-source .phps
AddType application/x-pilot .prc .pdb
AddType application/x-shockwave-flash .swf
AddType application/xrds+xml .xrdf
AddType text/plain .ini .sh .bsh .bash .awk .nawk .gawk .csh .var .c .in .h .asc .md5 .sha .sha1
AddType video/x-flv .flv
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
# Despite the name similarity, the following Add* directives have nothing
# to do with the FancyIndexing customization directives above.
#
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler php-cgi .php
#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
Action php-cgi /cgi-php-bin/php.cgi
# 1 YEAR
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header unset P3P
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
</filesMatch>
# 2 HOURS
<filesMatch "\.(html|htm|xml|txt|xsl)$">
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault A3600
</ifModule>
</filesMatch>
##############################################
# PERMANENT REDIRECTS #
##############################################
Redirect 301 /12-lessons-for-those-afraid-of-css.html http://www.askapache.com/css/12-lessons-for-those-afraid-of-css.html
Redirect 301 /2006/htaccess/htaccesselite-ultimate-htaccess-article.html http://www.askapache.com/htaccess/apache-htaccess.html
Redirect 301 /2007/phpbb/sending-post-form-data-with-php-curl.html http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html
Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.askapache.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.askapache.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
Redirect 301 /2007/webmaster/php-and-ajax-shell-console.html http://www.askapache.com/tools/php-and-ajax-shell-console.html
Redirect 301 /27-request-methods-for-use-with-apache-and-rewritecond-and-htaccess.html http://www.askapache.com/htaccess/27-request-methods-for-use-with-apache-and-rewritecond-and-htaccess.html
Redirect 301 /404-google-wordpress-plugin.html http://www.askapache.com/seo/404-google-wordpress-plugin.html
Redirect 301 /503-service-temporarily-unavailable.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /Overview-about.rdf http://www.askapache.com/askapache-home.rdf
Redirect 301 /abbr-acronym.html http://www.askapache.com/xhtml/abbr-acronym.html
Redirect 301 /adsense-robots.html http://www.askapache.com/google/adsense-robots.html
Redirect 301 /alexa-toolbar-firefox.html http://www.askapache.com/tools/alexa-toolbar-firefox.html
Redirect 301 /allowing-access-from-1-static-ip-and-deny-the-rest.html http://www.askapache.com/htaccess/apache-htaccess.html
Redirect 301 /anti-virus-spyware-rootkit.html http://www.askapache.com/security/anti-virus-spyware-rootkit.html
Redirect 301 /apache-ssl-in-htaccess-examples.html http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html
Redirect 301 /awk-tutorial.html http://www.askapache.com/awk/awk-tutorial.html
Redirect 301 /best-adsense-optimization.html http://www.askapache.com/wordpress/best-adsense-optimization.html
Redirect 301 /commonly-used-htaccess-code-examples.html http://www.askapache.com/htaccess/commonly-used-htaccess-code-examples.html
Redirect 301 /css-background-image-sprite.html http://www.askapache.com/css/css-background-image-sprite.html
Redirect 301 /css-browser-screenshots.html http://www.askapache.com/tools/css-browser-screenshots.html
Redirect 301 /css-class-example.html http://www.askapache.com/css/css-class-example.html
Redirect 301 /curl-multi-downloads.html http://www.askapache.com/php/curl-multi-downloads.html
Redirect 301 /custom-boot-menu-in-windows-xp.html http://www.askapache.com/windows/custom-boot-menu-in-windows-xp.html
Redirect 301 /donate http://www.dreamhost.com/donate.cgi?id=8261
Redirect 301 /donate/ http://www.dreamhost.com/donate.cgi?id=8261
Redirect 301 /htaccess.txt http://z.askapache.com/p/htaccess.txt
Redirect 301 /htaccess/404-errorpages.html http://www.askapache.com/seo/google-ajax-search-seo-tips.html
Redirect 301 /htaccess/feedsmith http://www.askapache.com/htaccess/feedsmith-htaccess.html
Redirect 301 /htaccess/http-status-codes.html http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html
Redirect 301 /htaccess/instruct-search-engines-to-come-back-to-site-after-you-finish-working-on-it.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /htaccess/speed-up-the-apache-web-server-with-configuration-hacks.html http://www.askapache.com/htaccess/apache-web-server-speed-configuration-hacks.html
Redirect 301 /instruct-search-engines-to-come-back-to-site-after-you-finish-working-on-it.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /security/bypassing-vlan.html http://www.askapache.com/security/hacking-vlan-switched-networks.html
Redirect 301 /security/bypassing-vlanbypassing-vlan.html http://www.askapache.com/security/hacking-vlan-switched-networks.html
Redirect 301 /security/rigging-the-dreamhost-site-of-the-month-contest.html http://www.askapache.com/dreamhost/rigging-the-dreamhost-site-of-the-month-contest.html
Redirect 301 /seo/tailrankcom-robot.html http://www.askapache.com/seo/tailrank-robot.html
Redirect 301 /webmaster/caching-tutorial-for-webmasters.html http://www.askapache.com/htaccess/caching-tutorial-for-webmasters.html
Redirect 301 /webmaster/lft-traceroute-tool.html http://www.askapache.com/tools/lft-traceroute-tool.html
##############################################
# TEMPORARY REDIRECTS #
##############################################
Redirect 302 /apachecse/ http://www.google.com/cse?cx=002660089121042511758:kk7rwc2gx0i&q=htaccess&sa=Search
Redirect 302 /apachecsetest/ http://www.google.com/cse?cx=002660089121042511758:kk7rwc2gx0i&q=htaccess&sa=Search
Redirect 302 /apachesearch/ http://www.google.com/cse?cx=002660089121042511758:kk7rwc2gx0i&q=htaccess&sa=Search
Redirect 307 /about/feeds/ http://feeds.askapache.com/apache/htaccess
Redirect 307 /about/feeds/it/ http://feeds.askapache.com/apache/htaccess
##############################################
# PERMANENT REDIRECTMATCH #
##############################################
RedirectMatch 301 ^/&(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/&(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/(.+)//$ http://www.askapache.com/$1/
RedirectMatch 301 ^/(.+)/htaccesselite-ultimate-htaccess-article.html(.*) http://www.askapache.com/htaccess/apache-htaccess.html
RedirectMatch 301 ^/(.+)\.html/([a-z][a-z])/$ http://www.askapache.com/$1.html
RedirectMatch 301 ^/([\(]+)(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/([^9]*)9O1X.3y(.*)/(.*)$ http://www.askapache.com/$2
RedirectMatch 301 ^/(ask-apache|dream)/(.*)$ http://www.askapache.com
RedirectMatch 301 ^/.3y(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/200([0-9])/([0-9])(.*)$ http://www.askapache.com/top-100/
RedirectMatch 301 ^/200([0-9])/([^01])(.*)$ http://www.askapache.com/$2$3
RedirectMatch 301 ^/about/glossary(.*)$ http://www.askapache.com/glossary$1
RedirectMatch 301 ^/apache-speed(.*)$ http://www.askapache.com/htaccess/apache-speed$1
RedirectMatch 301 ^/category/(.+)$ http://www.askapache.com/$1
RedirectMatch 301 ^/docs/(.*)$ http://askapache.info/$1
RedirectMatch 301 ^/htaccess/feedsmith-htaccess(.*) http://www.askapache.com/htaccess/redirecting-wordpress-feeds-to-feedburner.html
RedirectMatch 301 ^/robots-txt(.*)$ http://www.askapache.com/robots.txt
RedirectMatch 301 ^/wp-content/uploads/(.*)$ http://z.askapache.com/uploads/$1
RedirectMatch 301 ^/z/(.+)$ http://z.askapache.com/$1
RedirectMatch 301 ^/(t|i|uploads)/(.*)$ http://z.askapache.com/$1/$2
RedirectMatch 301 ^/wp-content/uploads/(.*)$ http://z.askapache.com/uploads/$1
RedirectMatch 301 ^/hosting/?$ http://www.askapache.com/hosting/
##############################################
# TEMPORARY REDIRECTMATCH #
##############################################
RedirectMatch 307 ^/(.*)/dynamicdns/$ http://www.askapache.com/$1
RedirectMatch 307 ^/getflash/?$ http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash
RedirectMatch 307 ^/dream/?$ http://www.askapache.com/dreamhost/
RedirectMatch 307 ^/cse/?$ http://www.google.com/cse?cx=002660089121042511758:kk7rwc2gx0i&q=htaccess&sa=Search
RewriteEngine On
RewriteBase /
#RewriteCond %{REQUEST_URI} ^/(stats/|missing\.html|failed_auth\.html|error/).* [NC,OR]
#RewriteCond %{ENV:REDIRECT_STATUS} =200
#RewriteRule .* - [L]
#RewriteCond %{HTTPS} !=on [NC]
#RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /wp-login(.+)\ HTTP/ [NC]
#RewriteRule .+ https://www.askapache.com/wp-login%1 [R,L]
RewriteCond %{REQUEST_URI} ^/(error/.*|w3c/.*|openid/.*|y_key_bf61afd498f7623a\.html|yadis\.xrdf|askapache-home\.rdf|wlmmanifest\.xml|os-description\.xml|labels\.rdf|gnu-fdl\.txt)$ [NC]
RewriteRule .* /X/%1 [L]
RewriteRule ^osq?(.*)$ /wp-content/plugins/wp-opensearch.php?$1 [QSA,L]
RewriteCond %{HTTP_ACCEPT} application/xrds\+xml
RewriteCond %{HTTP_ACCEPT} !application/xrds\+xml\s*;\s*q\s*=\s*0(\.0{1,3})?\s*(,|$)
RewriteRule ^$ http://www.askapache.com/yadis.xrdf [R,L]
RewriteCond %{REQUEST_URI} ^/cgi-bin/(hash|java).cgi$ [NC]
RewriteCond %{HTTP:P3P} ^(([^:]+):(.+))$ [NC]
RewriteRule .* - [E=HTTP_JS:%{HTTP:P3P},E=HTTP_US:%2,E=HTTP_PA:%3]
RewriteCond %{REQUEST_URI} ^/openid.*$ [NC]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},E=REMOTE_USER:%{HTTP:Authorization}]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.+)\.rdf\ HTTP/ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/rdf/%1.html/index.rdf -f
RewriteRule ^(.*)$ /wp-content/rdf/%1.html/index.rdf [L,S=1]
RewriteCond %{HTTP_USER_AGENT} !^(FeedBurner|FeedValidator|talkr.com).* [NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(feed|rdf|rss|rss2|atom|wp-atom|wp-feed|wp-rdf|wp-rss|wp-rss2).*\ HTTP/ [NC]
RewriteRule .* http://feeds.askapache.com/apache/htaccess? [R=302,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.pdf$ /cgi-bin/pdf.php?file=$1.pdf [L,NC]
RewriteCond %{REMOTE_ADDR} ^$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.phps$ /cgi-bin/phps.php?file=$1.php [L,NC]
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD) [OR]
RewriteCond %{QUERY_STRING} !^$ [OR]
RewriteCond %{HTTP_COOKIE} ^.*(comment_author_|wordpress|wp-postpass_).*$ [NC]
RewriteRule ^(.*)$ - [S=6]
RewriteCond %{HTTP_USER_AGENT} .*W3C_Validator.* [NC]
RewriteCond %{HTTP:Accept-Encoding} gzip [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml.gz -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml.gz [L,S=5]
RewriteCond %{HTTP:Accept} application/xhtml\+xml [NC]
RewriteCond %{HTTP:Accept-Encoding} gzip [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml.gz -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml.gz [L,S=4]
RewriteCond %{HTTP:Accept-Encoding} gzip [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.html.gz -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.html.gz [L,S=3]
RewriteCond %{HTTP_USER_AGENT} .*W3C_Validator.* [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml [L,S=2]
RewriteCond %{HTTP:Accept} application/xhtml\+xml [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml [L,S=1]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.html -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.html [L]
# BEGIN WordPress
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</ifModule>
# END WordPress
Some Unusual Security Use
##############################################
# SECURITY #
##############################################
SecFilterEngine Off
DirectoryIndex index.html
Options +FollowSymLinks
AddHandler application/x-httpd-php .php
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} !^tyy+$ [NC]
RewriteCond %{REMOTE_USER} ^(.+)$
RewriteRule ^(.*)$ $1/-%1 [R=302,L]
Options +FollowSymLinks
DirectoryIndex index.php
ErrorDocument 404 /cgi-bin/pro/index.php
AuthName "Protection"
AuthUserFile /home/.greer/askapache/sites/askapache.com/.htpasswda1
AuthGroupFile /dev/null
AuthType Basic
Require valid-user
Satisfy Any
#Action php-cgi /cgi-sphp-bin/sphp5.cgi
<ifModule mod_security.c>
SecFilterEngine Off
</ifModule>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^R
RewriteRule ^.*$ - [S=53]
RewriteCond %{QUERY_STRING} ^Q=API_VERSION$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{API_VERSION} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=AUTH_TYPE$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{AUTH_TYPE} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=CONTENT_LENGTH$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{CONTENT_LENGTH} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=CONTENT_TYPE$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{CONTENT_TYPE} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=DEFAULT_PATH$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{DEFAULT_PATH} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=DOCUMENT_ROOT$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{DOCUMENT_ROOT} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=HTTPS$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{HTTPS} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=HTTP_ACCEPT$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{HTTP_ACCEPT} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=HTTP_COOKIE$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{HTTP_COOKIE} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=HTTP_FORWARDED$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{HTTP_FORWARDED} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=HTTP_HOST$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{HTTP_HOST} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=HTTP_PROXY_CONNECTION$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{HTTP_PROXY_CONNECTION} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=HTTP_REFERER$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{HTTP_REFERER} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=HTTP_USER_AGENT$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{HTTP_USER_AGENT} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=IS_SUBREQ$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{IS_SUBREQ} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=PATH$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{PATH} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=PATH_INFO$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{PATH_INFO} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=PHP_DOCUMENT_ROOT$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{PHP_DOCUMENT_ROOT} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=QUERY_ARGS$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{QUERY_ARGS} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=QUERY_STRING$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{QUERY_STRING} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=REMOTE_ADDR$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{REMOTE_ADDR} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=REMOTE_HOST$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{REMOTE_HOST} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=REMOTE_IDENT$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{REMOTE_IDENT} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=REMOTE_PORT$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{REMOTE_PORT} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=REMOTE_USER$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{REMOTE_USER} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=REQUEST_FILENAME$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{REQUEST_FILENAME} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=REQUEST_METHOD$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{REQUEST_METHOD} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=REQUEST_URI$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{REQUEST_URI} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=REQUEST_URI$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{REQUEST_URI} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=SCRIPT_FILENAME$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{SCRIPT_FILENAME} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=SCRIPT_GROUP$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{SCRIPT_GROUP} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=SCRIPT_NAME$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{SCRIPT_NAME} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=SCRIPT_URI$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{SCRIPT_URI} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=SCRIPT_URL$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{SCRIPT_URL} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=SCRIPT_USER$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{SCRIPT_USER} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=SECURITY_HOLE_PASS_AUTHORIZATION$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{SECURITY_HOLE_PASS_AUTHORIZATION} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=SERVER_ADDR$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{SERVER_ADDR} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=SERVER_ADMIN$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{SERVER_ADMIN} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=SERVER_HOSTNAME$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{SERVER_HOSTNAME} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=SERVER_NAME$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{SERVER_NAME} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=SERVER_PORT$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{SERVER_PORT} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=SERVER_PROTOCOL$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{SERVER_PROTOCOL} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=SERVER_SOFTWARE$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{SERVER_SOFTWARE} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=THE_REQUEST$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{THE_REQUEST} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=TIME$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{TIME} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=TIME_DAY$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{TIME_DAY} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=TIME_HOUR$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{TIME_HOUR} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=TIME_MIN$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{TIME_MIN} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=TIME_MON$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{TIME_MON} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=TIME_SEC$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{TIME_SEC} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=TIME_WDAY$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{TIME_WDAY} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=TIME_YEAR$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{TIME_YEAR} [R=302,L]
RewriteCond %{QUERY_STRING} ^Q=USER$ [NC]
RewriteRule ^.*$ http://www.askapache.com/cgi-bin/pro/?R=%{USER} [R=302,L]
Options +ExecCGI
<filesMatch "(search|google-reader|phps|p|pdf1|topsite)\.php$">
Order Deny,Allow
Deny from All
Allow from 208.113.134.190 64.111.114.111 env=REDIRECT_STATUS
</filesMatch>
<filesMatch "\.(cgi|sh)$">
Order Deny,Allow
Deny from All
Allow from 208.113.134.190 64.111.114.111 env=REDIRECT_STATUS
</filesMatch>
#SetEnvIf Remote_Addr ^$ MODSEC_ENABLE=Off
#SetEnvIf Server_Addr ^$ MODSEC_ENABLE=Off
#SetEnvIf Remote_Addr ^({SERVER_ADDR}e)$ GOOD=$1
#SetEnvIf Server_Addr GOOD R
#RewriteRule .* - [E=HTTP_JS:%{HTTP:P3P}]
#Allow from 208.113.134.190 env=REDIRECT_STATUS
#Allow from env=SERVER_ADDR
#
#Allow from 208.113.134.190Options +ExecCGI -Indexes +FollowSymLinks
Order Deny,Allow
Deny from All
Allow from 208.113.134.190 64.111.114.111 env=REDIRECT_STATUS
Header set Retry-After "360"
Header set Connection "close"Options +Indexes +FollowSymLinks
DirectoryIndex index.html
Header unset P3P
Options -IndexesOptions -Indexes
RewriteEngine On
RewriteCond %{HTTP_COOKIE} !^.*MP3P=([0-9]+).* [NC]
RewriteRule .* - [F,L]
Options +ExecCGI -Indexes +FollowSymLinks
Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUSOptions -IndexesOptions +IndexesOptions -IndexesOptions +IndexesOptions -MultiViews -Indexes -Includes -ExecCGI +FollowSymLinks
DirectoryIndex /index.php
### DEFAULTS ###
DefaultType text/plain
AddType text/plain .ini .sh .bsh .bash .awk .nawk .gawk .csh .var .c .in .h
AddType video/x-flv .flv
AddType application/x-shockwave-flash .swf
#AddType image/vnd.microsoft.icon .ico
#AddType image/x-icon .ico
AddType application/octet-stream .rar .pdf .chm .bz2 .tgz .msi
AddType application/vnd.ms-excel .csv
AddDefaultCharset UTF-8
SetEnv TZ America/Indianapolis
SetEnv SERVER_ADMIN webmaster@askapache.com
##############################################
# SECURITY #
##############################################
ServerSignature Off
### PHPINI-CGI ###
<files index.php>
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php5.cgi
</files>
<files pdf.php>
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php5.cgi
</files>
# BEGIN AskApache ErrorDocument
ErrorDocument 400 /index.php
ErrorDocument 401 /index.php
ErrorDocument 402 /index.php
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php
ErrorDocument 405 /index.php
ErrorDocument 406 /index.php
ErrorDocument 407 /index.php
ErrorDocument 408 /index.php
ErrorDocument 409 /index.php
ErrorDocument 410 /index.php
ErrorDocument 411 /index.php
ErrorDocument 412 /index.php
ErrorDocument 413 /index.php
ErrorDocument 414 /index.php
ErrorDocument 415 /index.php
ErrorDocument 416 /index.php
ErrorDocument 417 /index.php
ErrorDocument 418 /index.php
ErrorDocument 419 /index.php
ErrorDocument 420 /index.php
ErrorDocument 421 /index.php
ErrorDocument 422 /index.php
ErrorDocument 423 /index.php
ErrorDocument 424 /index.php
ErrorDocument 425 /index.php
ErrorDocument 426 /index.php
ErrorDocument 500 /index.php
ErrorDocument 501 /index.php
ErrorDocument 502 /index.php
ErrorDocument 503 /index.php
ErrorDocument 504 /index.php
ErrorDocument 505 /index.php
ErrorDocument 506 /index.php
ErrorDocument 507 /index.php
ErrorDocument 508 /index.php
ErrorDocument 509 /index.php
ErrorDocument 510 /index.php
# END AskApache ErrorDocument
##############################################
# HEADERS and CACHING #
##############################################
Header unset Pragma
FileETag None
Header unset ETag
# 1 YEAR
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$">
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Last-Modified
</filesMatch>
# 2 HOURS
<filesMatch "\.(html|htm|xml|txt|xsl)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</filesMatch>
<filesMatch "feed(1|2|3)?\.gif$">
Header unset Expires
Header set Cache-Control "no-cache, must-revalidate"
</filesMatch>
### COMPRESSION
<filesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Last-Modified
</filesMatch>
RedirectMatch 301 ^/t/bash/HTML/(.*)$ http://z.askapache.com/shell-scripts/bash/$1
RedirectMatch 301 ^/j/urchin(.*)js$ http://z.askapache.com/j/ga$1js
RedirectMatch 301 ^/t/bash/(.*)$ http://z.askapache.com/shell-scripts/bash/$1
#RedirectMatch 301 ^/f/(.*)$ http://f.askapache.com/$1
RedirectMatch 301 ^/uploads/aa-password(.*)$ http://extend.wordpress.org/plugin/askapache-password-protect/
### REWRITES ###
RewriteEngine On
RewriteBase /
RewriteCond %{TIME_MIN} ^(0|4|8|12|16|22|26|30|34|38|42|46|50|54|58)$
RewriteRule ^i/feed\.gif$ /i/feed1.gif [L,NC,S=2]
RewriteCond %{TIME_MIN} ^(1|5|9|13|17|23|27|31|35|39|43|47|51|55|59)$
RewriteRule ^i/feed\.gif$ /i/feed2.gif [L,NC,S=1]
RewriteCond %{TIME_MIN} ^(2|6|10|14|18|24|28|32|36|40|44|48|52|56|60)$
RewriteRule ^i/feed\.gif$ /i/feed3.gif [L,NC]
RewriteCond %{TIME_MIN} ^(3|7|11|15|19|25|29|33|37|41|45|49|53|57)$
RewriteRule ^i/feed\.gif$ /i/feed4.gif [L,NC]
RewriteRule ^([cj]+)(/?[a-z]*)/([a-z]+)-([0-9]+)\.(js|css)$ /$1$2/$3.$5 [L]
#RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ /.*\.(swf|xml).*\ HTTP/ [NC]
#RewriteCond %{QUERY_STRING} .
#RewriteRule (.*) /$1? [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.+)\.pdf$ /pdf.php [L,NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /f/mp3/songs/?\ HTTP/ [NC,OR]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(cgi-bin|index\.php).*\ HTTP/ [NC]
RewriteRule .* - [L,E=REDIRECT_STATUS:403]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.php [NC,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^(.*)$
RewriteRule .* - [L]
Header set Retry-After "360"
Header set Connection "close"Options +Indexes +FollowSymLinks
DirectoryIndex index.html
Header unset P3P
### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#
#
# TZ: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
SetEnv TZ America/Indianapolis
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
SetEnv SERVER_ADMIN webmaster@askapache.com
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.0/mod/core.html#options
# for more information.
#
Options +FollowSymLinks -ExecCGI -Indexes -Includes -MultiViews
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
DirectoryIndex index.html index.php /index.php
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<filesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</filesMatch>
#
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/html
#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of: On | Off | EMail
#
ServerSignature Off
##############################################
# HEADERS and CACHING #
##############################################
Header unset Pragma
Header unset Last-Modified
FileETag None
Redirect 400 /e/400
Redirect 401 /e/401
Redirect 402 /e/402
Redirect 403 /e/403
Redirect 404 /e/404
Redirect 405 /e/405
Redirect 406 /e/406
Redirect 407 /e/407
Redirect 408 /e/408
Redirect 409 /e/409
Redirect 410 /e/410
Redirect 411 /e/411
Redirect 412 /e/412
Redirect 413 /e/413
Redirect 414 /e/414
Redirect 415 /e/415
Redirect 416 /e/416
Redirect 417 /e/417
Redirect 418 /e/418
Redirect 419 /e/419
Redirect 420 /e/420
Redirect 421 /e/421
Redirect 422 /e/422
Redirect 423 /e/423
Redirect 424 /e/424
Redirect 425 /e/425
Redirect 426 /e/426
Redirect 500 /e/500
Redirect 501 /e/501
Redirect 502 /e/502
Redirect 503 /e/503
Redirect 504 /e/504
Redirect 505 /e/505
Redirect 506 /e/506
Redirect 507 /e/507
Redirect 508 /e/508
Redirect 509 /e/509
Redirect 510 /e/510
#
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
##############################################
# PERMANENT REDIRECTS #
##############################################
Redirect 301 /12-lessons-for-those-afraid-of-css.html http://www.askapache.com/css/12-lessons-for-those-afraid-of-css.html
Redirect 301 /2006/htaccess/htaccesselite-ultimate-htaccess-article.html http://www.askapache.com/htaccess/apache-htaccess.html
Redirect 301 /2007/phpbb/sending-post-form-data-with-php-curl.html http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html
Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.askapache.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.askapache.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
Redirect 301 /2007/webmaster/php-and-ajax-shell-console.html http://www.askapache.com/tools/php-and-ajax-shell-console.html
Redirect 301 /27-request-methods-for-use-with-apache-and-rewritecond-and-htaccess.html http://www.askapache.com/htaccess/27-request-methods-for-use-with-apache-and-rewritecond-and-htaccess.html
Redirect 301 /404-google-wordpress-plugin.html http://www.askapache.com/seo/404-google-wordpress-plugin.html
Redirect 301 /503-service-temporarily-unavailable.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /Overview-about.rdf http://www.askapache.com/askapache-home.rdf
Redirect 301 /abbr-acronym.html http://www.askapache.com/xhtml/abbr-acronym.html
Redirect 301 /adsense-robots.html http://www.askapache.com/google/adsense-robots.html
Redirect 301 /alexa-toolbar-firefox.html http://www.askapache.com/tools/alexa-toolbar-firefox.html
Redirect 301 /allowing-access-from-1-static-ip-and-deny-the-rest.html http://www.askapache.com/htaccess/apache-htaccess.html
Redirect 301 /anti-virus-spyware-rootkit.html http://www.askapache.com/security/anti-virus-spyware-rootkit.html
Redirect 301 /apache-ssl-in-htaccess-examples.html http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html
Redirect 301 /awk-tutorial.html http://www.askapache.com/awk/awk-tutorial.html
Redirect 301 /best-adsense-optimization.html http://www.askapache.com/wordpress/best-adsense-optimization.html
Redirect 301 /commonly-used-htaccess-code-examples.html http://www.askapache.com/htaccess/commonly-used-htaccess-code-examples.html
Redirect 301 /css-background-image-sprite.html http://www.askapache.com/css/css-background-image-sprite.html
Redirect 301 /css-browser-screenshots.html http://www.askapache.com/tools/css-browser-screenshots.html
Redirect 301 /css-class-example.html http://www.askapache.com/css/css-class-example.html
Redirect 301 /curl-multi-downloads.html http://www.askapache.com/php/curl-multi-downloads.html
Redirect 301 /custom-boot-menu-in-windows-xp.html http://www.askapache.com/windows/custom-boot-menu-in-windows-xp.html
Redirect 301 /donate http://www.dreamhost.com/donate.cgi?id=8261
Redirect 301 /donate/ http://www.dreamhost.com/donate.cgi?id=8261
Redirect 301 /htaccess.txt http://z.askapache.com/p/htaccess.txt
Redirect 301 /htaccess/404-errorpages.html http://www.askapache.com/seo/google-ajax-search-seo-tips.html
Redirect 301 /htaccess/feedsmith http://www.askapache.com/htaccess/feedsmith-htaccess.html
Redirect 301 /htaccess/http-status-codes.html http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html
Redirect 301 /htaccess/instruct-search-engines-to-come-back-to-site-after-you-finish-working-on-it.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /htaccess/speed-up-the-apache-web-server-with-configuration-hacks.html http://www.askapache.com/htaccess/apache-web-server-speed-configuration-hacks.html
Redirect 301 /instruct-search-engines-to-come-back-to-site-after-you-finish-working-on-it.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /security/bypassing-vlan.html http://www.askapache.com/security/hacking-vlan-switched-networks.html
Redirect 301 /security/bypassing-vlanbypassing-vlan.html http://www.askapache.com/security/hacking-vlan-switched-networks.html
Redirect 301 /security/rigging-the-dreamhost-site-of-the-month-contest.html http://www.askapache.com/dreamhost/rigging-the-dreamhost-site-of-the-month-contest.html
Redirect 301 /seo/tailrankcom-robot.html http://www.askapache.com/seo/tailrank-robot.html
Redirect 301 /webmaster/caching-tutorial-for-webmasters.html http://www.askapache.com/htaccess/caching-tutorial-for-webmasters.html
Redirect 301 /webmaster/lft-traceroute-tool.html http://www.askapache.com/tools/lft-traceroute-tool.html
##############################################
# PERMANENT REDIRECTMATCH #
##############################################
#RedirectMatch 301 ^/&(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/&(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/([^/]+)//$ http://www.askapache.com/$1/
RedirectMatch 301 ^/(.+)/htaccesselite-ultimate-htaccess-article.html(.*) http://www.askapache.com/htaccess/apache-htaccess.html
RedirectMatch 301 ^/(.+)\.html/([a-z][a-z])/$ http://www.askapache.com/$1.html
RedirectMatch 301 ^/([\(]+)(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/([^9]*)9O1X.3y(.*)/(.*)$ http://www.askapache.com/$2
RedirectMatch 301 ^/.3y(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/200([0-9])/([0-9])(.*)$ http://www.askapache.com/top-100/
RedirectMatch 301 ^/200([0-9])/([^01])(.*)$ http://www.askapache.com/$2$3
RedirectMatch 301 ^/about/glossary(.*)$ http://www.askapache.com/glossary$1
RedirectMatch 301 ^/apache-speed(.*)$ http://www.askapache.com/htaccess/apache-speed$1
RedirectMatch 301 ^/category/(.+)$ http://www.askapache.com/$1
RedirectMatch 301 ^/docs/(.*)$ http://askapache.info/$1
RedirectMatch 301 ^/htaccess/feedsmith-htaccess(.*) http://www.askapache.com/htaccess/redirecting-wordpress-feeds-to-feedburner.html
RedirectMatch 301 ^/robots-txt(.*)$ http://www.askapache.com/robots.txt
#RedirectMatch 301 ^/wp-content/uploads/(.*)$ http://z.askapache.com/uploads/$1
RedirectMatch 301 ^/z/(.+)$ http://z.askapache.com/$1
RedirectMatch 301 ^/(z|t|i|j|c|p)/(.*)$ http://z.askapache.com/$1/$2
RedirectMatch 301 ^/hosting/?$ http://www.askapache.com/hosting/
##############################################
# TEMPORARY REDIRECTMATCH #
##############################################
RedirectMatch 307 ^/getflash/?$ http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash
RedirectMatch 307 ^/dream/?$ http://www.askapache.com/dreamhost/
RedirectMatch 307 ^/(cse|apachecse|apachecsetest|apachesearch)/?$ http://www.google.com/coop/cse?cx=002660089121042511758%3Akk7rwc2gx0i
#
# Commonly used filename extensions to character sets. You probably
# want to avoid clashes with the language extensions, unless you
# are good at carefully testing your setup after each change.
# See http://www.iana.org/assignments/character-sets for the
# official list of charset names and their respective RFCs.
#
AddDefaultCharset UTF-8
#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
#
AddType 'application/rdf+xml; charset=UTF-8' .rdf
AddType 'application/xhtml+xml; charset=UTF-8' .xhtml
AddType 'application/xhtml+xml; charset=UTF-8' .xhtml.gz
AddType 'text/html; charset=UTF-8' .html
AddType 'text/html; charset=UTF-8' .html.gz
AddType application/octet-stream .rar .chm .bz2 .tgz .msi .pdf .exe
AddType application/vnd.ms-excel .csv
AddType application/x-httpd-php-source .phps
AddType application/x-pilot .prc .pdb
AddType application/x-shockwave-flash .swf
AddType application/xrds+xml .xrdf
AddType text/plain .ini .sh .bsh .bash .awk .nawk .gawk .csh .var .c .in .h .asc .md5 .sha .sha1
AddType video/x-flv .flv
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
# Despite the name similarity, the following Add* directives have nothing
# to do with the FancyIndexing customization directives above.
#
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler php-cgi .php
#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
Action php-cgi /cgi-bin/php.cgi
#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
#100 Continue
#101 Switching Protocols
#102 Processing
#200 OK
#201 Created
#202 Accepted
#203 Non-Authoritative Information
#204 No Content
#205 Reset Content
#206 Partial Content
#207 Multi-Status
#300 Multiple Choices
#301 Moved Permanently
#302 Found
#303 See Other
#304 Not Modified
#305 Use Proxy
#306 unused
#307 Temporary Redirect
#400 Bad Request
#401 Authorization Required
#402 Payment Required
#403 Forbidden
#404 Not Found
#405 Method Not Allowed
#406 Not Acceptable
#407 Proxy Authentication Required
#408 Request Time-out
#409 Conflict
#410 Gone
#411 Length Required
#412 Precondition Failed
#413 Request Entity Too Large
#414 Request-URI Too Large
#415 Unsupported Media Type
#416 Requested Range Not Satisfiable
#417 Expectation Failed
#418 unused
#419 unused
#420 unused
#421 unused
#422 Unprocessable Entity
#423 Locked
#424 Failed Dependency
#425 No code
#426 Upgrade Required
#500 Internal Server Error
#501 Method Not Implemented
#502 Bad Gateway
#503 Service Temporarily Unavailable
#504 Gateway Time-out
#505 HTTP Version Not Supported
#506 Variant Also Negotiates
#507 Insufficient Storage
#508 unused
#509 unused
#510 Not Extended
#ErrorDocument 100 /X/err/1/HTTP_CONTINUE.html
#ErrorDocument 101 /X/err/1/HTTP_SWITCHING_PROTOCOLS.html
#ErrorDocument 102 /X/err/1/HTTP_PROCESSING.html
#ErrorDocument 200 /X/err/2/HTTP_OK.html
#ErrorDocument 201 /X/err/2/HTTP_CREATED.html
#ErrorDocument 202 /X/err/2/HTTP_ACCEPTED.html
#ErrorDocument 203 /X/err/2/HTTP_NON_AUTHORITATIVE.html
#ErrorDocument 204 /X/err/2/HTTP_NO_CONTENT.html
#ErrorDocument 205 /X/err/2/HTTP_RESET_CONTENT.html
#ErrorDocument 206 /X/err/2/HTTP_PARTIAL_CONTENT.html
#ErrorDocument 207 /X/err/2/HTTP_MULTI_STATUS.html
#ErrorDocument 300 /X/err/HTTP_MULTIPLE_CHOICES.html
#ErrorDocument 301 /X/err/HTTP_MOVED_PERMANENTLY.html
#ErrorDocument 302 /X/err/HTTP_MOVED_TEMPORARILY.html
#ErrorDocument 303 /X/err/HTTP_SEE_OTHER.html
#ErrorDocument 304 /X/err/HTTP_NOT_MODIFIED.html
#ErrorDocument 305 /X/err/HTTP_USE_PROXY.html
#ErrorDocument 307 /X/err/HTTP_TEMPORARY_REDIRECT.html
#ErrorDocument 404 /X/err/HTTP_NOT_FOUND.html
ErrorDocument 400 /X/err/4/HTTP_BAD_REQUEST.html
ErrorDocument 401 /X/err/4/HTTP_UNAUTHORIZED.html
ErrorDocument 402 /X/err/4/HTTP_PAYMENT_REQUIRED.html
ErrorDocument 403 /X/err/4/HTTP_FORBIDDEN.html
ErrorDocument 405 /X/err/4/HTTP_METHOD_NOT_ALLOWED.html
ErrorDocument 406 /X/err/4/HTTP_NOT_ACCEPTABLE.html
ErrorDocument 407 /X/err/4/HTTP_PROXY_AUTHENTICATION_REQUIRED.html
ErrorDocument 408 /X/err/4/HTTP_REQUEST_TIME_OUT.html
ErrorDocument 409 /X/err/4/HTTP_CONFLICT.html
ErrorDocument 410 /X/err/4/HTTP_GONE.html
ErrorDocument 411 /X/err/4/HTTP_LENGTH_REQUIRED.html
ErrorDocument 412 /X/err/4/HTTP_PRECONDITION_FAILED.html
ErrorDocument 413 /X/err/4/HTTP_REQUEST_ENTITY_TOO_LARGE.html
ErrorDocument 414 /X/err/4/HTTP_REQUEST_URI_TOO_LARGE.html
ErrorDocument 415 /X/err/4/TTP_UNSUPPORTED_MEDIA_TYPE.html
ErrorDocument 416 /X/err/4/HTTP_RANGE_NOT_SATISFIABLE.html
ErrorDocument 417 /X/err/4/HTTP_EXPECTATION_FAILED.html
ErrorDocument 422 /X/err/4/HTTP_UNPROCESSABLE_ENTITY.html
ErrorDocument 423 /X/err/4/HTTP_LOCKED.html
ErrorDocument 424 /X/err/4/HTTP_FAILED_DEPENDENCY.html
ErrorDocument 426 /X/err/4/HTTP_UPGRADE_REQUIRED.html
ErrorDocument 500 /X/err/5/HTTP_INTERNAL_SERVER_ERROR.html
ErrorDocument 501 /X/err/5/HTTP_NOT_IMPLEMENTED.html
ErrorDocument 502 /X/err/5/HTTP_BAD_GATEWAY.html
ErrorDocument 503 /X/err/5/HTTP_SERVICE_UNAVAILABLE.html
ErrorDocument 504 /X/err/5/HTTP_GATEWAY_TIME_OUT.html
ErrorDocument 505 /X/err/5/HTTP_VERSION_NOT_SUPPORTED.html
ErrorDocument 506 /X/err/5/HTTP_VARIANT_ALSO_VARIES.html
ErrorDocument 507 /X/err/5/HTTP_INSUFFICIENT_STORAGE.html
ErrorDocument 510 /X/err/5/HTTP_NOT_EXTENDED.html
ErrorDocument 404 /index.php?error=404
# 1 YEAR
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header unset P3P
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
</filesMatch>
# 2 HOURS
<filesMatch "\.(html|htm|xml|txt|xsl)$">
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault A3600
</ifModule>
</filesMatch>
RewriteEngine On
RewriteBase /
#RewriteCond %{REQUEST_URI} ^/(stats/|missing\.html|failed_auth\.html|error/).* [NC,OR]
#RewriteCond %{ENV:REDIRECT_STATUS} =200
#RewriteRule .* - [L]
#RewriteCond %{HTTPS} !=on [NC]
#RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /wp-login(.+)\ HTTP/ [NC]
#RewriteRule .+ https://www.askapache.com/wp-login%1 [R,L]
RewriteCond %{REQUEST_URI} ^/(error/.*|w3c/.*|openid/.*|y_key_bf61afd498f7623a\.html|yadis\.xrdf|askapache-home\.rdf|wlmmanifest\.xml|os-description\.xml|labels\.rdf|gnu-fdl\.txt)$ [NC]
RewriteRule .* /X/%1 [L]
RewriteRule ^osq?(.*)$ /wp-content/plugins/wp-opensearch.php?$1 [QSA,L]
RewriteCond %{HTTP_ACCEPT} application/xrds\+xml
RewriteCond %{HTTP_ACCEPT} !application/xrds\+xml\s*;\s*q\s*=\s*0(\.0{1,3})?\s*(,|$)
RewriteRule ^$ http://www.askapache.com/yadis.xrdf [R,L]
RewriteCond %{REQUEST_URI} ^/cgi-bin/(hash|java).cgi$ [NC]
RewriteCond %{HTTP:P3P} ^(([^:]+):(.+))$ [NC]
RewriteRule .* - [E=HTTP_JS:%{HTTP:P3P},E=HTTP_US:%2,E=HTTP_PA:%3]
RewriteCond %{REQUEST_URI} ^/openid.*$ [NC]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},E=REMOTE_USER:%{HTTP:Authorization}]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.+)\.rdf\ HTTP/ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/rdf/%1.html/index.rdf -f
RewriteRule ^(.*)$ /wp-content/rdf/%1.html/index.rdf [L,S=1]
RewriteCond %{HTTP_USER_AGENT} !^(FeedBurner|FeedValidator|talkr.com).* [NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(feed|rdf|rss|rss2|atom|wp-atom|wp-feed|wp-rdf|wp-rss|wp-rss2).*\ HTTP/ [NC]
RewriteRule .* http://feeds.askapache.com/apache/htaccess? [R=302,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.pdf$ /cgi-bin/pdf.php?file=$1.pdf [L,NC]
RewriteCond %{REMOTE_ADDR} ^$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.phps$ /cgi-bin/phps.php?file=$1.php [L,NC]
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD) [OR]
RewriteCond %{QUERY_STRING} !^$ [OR]
RewriteCond %{HTTP_COOKIE} ^.*(comment_author_|wordpress|wp-postpass_).*$ [NC]
RewriteRule ^(.*)$ - [S=6]
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD) [OR]
RewriteCond %{QUERY_STRING} !^$ [OR]
RewriteCond %{HTTP_COOKIE} ^.*(comment_author_|wordpress|wp-postpass_).*$ [NC]
RewriteRule ^(.*)$ - [S=6]
RewriteCond %{HTTP_USER_AGENT} .*W3C_Validator.* [NC]
RewriteCond %{HTTP:Accept-Encoding} gzip [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml.gz -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml.gz [L,S=5]
RewriteCond %{HTTP:Accept} application/xhtml\+xml [NC]
RewriteCond %{HTTP:Accept-Encoding} gzip [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml.gz -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml.gz [L,S=4]
RewriteCond %{HTTP:Accept-Encoding} gzip [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.html.gz -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.html.gz [L,S=3]
RewriteCond %{HTTP_USER_AGENT} .*W3C_Validator.* [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml [L,S=2]
RewriteCond %{HTTP:Accept} application/xhtml\+xml [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml [L,S=1]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.html -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.html [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.+)\.rdf\ HTTP/ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/%1.html/index.rdf -f
RewriteRule ^(.*)$ /wp-content/cache/aa/%1.html/index.rdf [L]
# BEGIN WordPress
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</ifModule>
# END WordPress
##############################################
# SECURITY #
##############################################
SetEnvIf Request_URI "^/(online-tools/js-compress/?|cgi-bin/java\.cgi|wp-admin/.*)" MODSEC_ENABLE=Off
SetEnvIfNoCase Remote_Addr ^208\.113\.134\.190$ MODSEC_ENABLE=Off
SecFilterEngine On
SecFilterCheckURLEncoding On
SecFilterCheckUnicodeEncoding Off
SecFilterScanPOST On
SecAuditEngine RelevantOnly
SecAuditLog /home/askapache/sites/askapache.com/logs/modsec_audit.log
SecFilterDebugLog /home/askapache/sites/askapache.com/logs/modsec_debug.log
SecFilterDebugLevel 1
SecAuditLogRelevantStatus "^(?:1|2(?!00)|5|4(?!04))"
SecFilterDefaultAction "deny,log,auditlog,severity:2,status:403"
#Enforce proper HTTP requests
SecFilterSelective SERVER_PROTOCOL "!^HTTP/(0\.9|1\.0|1\.1)$" "id:340000,rev:1,severity:1,msg:'Bad HTTP Protocol'"
# Only accept request encodings we know how to handle
SecFilterSelective REQUEST_METHOD "!^(GET|HEAD|POST)$" "chain,id:340001,rev:1,severity:2,msg:'Restricted HTTP function'"
SecFilterSelective HTTP_Content-Type "!(^$|^application/x-www-form-urlencoded$|^multipart/form-data)"
#Generic rule for allowed characters, adjust for your site before activating
#SecFilterSelective REQUEST_URI "!^[a-zA-Z0-9\.\+\_\/\-\?\=\&\%\#]+$" "chain,id:390002,rev:1,severity:2,msg:'Restricted HTTP character set'"
#SecFilterSelective REQUEST_URI "!^/(openid|wp-admin|wp-includes|wp-content|wp-login.php)"
# Require Content-Length to be provided with every POST request
SecFilterSelective REQUEST_METHOD "^POST$" "chain,id:340003,rev:1,severity:2,msg:'Content Length not provided with POST'"
SecFilterSelective HTTP_Content-Length "^$"
# Don't accept transfer encodings we know we don't handle
# (and you don't need it anyway)
SecFilterSelective HTTP_Transfer-Encoding "!^$" "id:340004,rev:1,severity:2,msg:'Dis-allowed Transfer Encoding'"
#HTTP response splitting generic sigs
SecFilter "Content-Length\:.*Content-Type\:.*Content-Type\:" "id:340005,rev:1,severity:2,msg:'HTTP response splitting'"
#HTTP response splitting generic sigs
SecFilter "Content-Length\:" "chain,id:340006,rev:1,severity:2,msg:'HTTP response splitting'"
SecFilter "Content-Type\:"
#catch smuggling attacks
SecFilter "^(GET|POST).*Host:.*^(GET|POST)" "id:300012,rev:1,severity:2,msg:'catch smuggling attacks'"
#XSS insertion into Content-Type
SecFilterSelective THE_REQUEST "Content-Type\:.*(<[[:space:]]*(script|about|applet|activex|chrome)*>.*(script|about|applet|activex|chrome)[[:space:]]*>|onmouseover=|javascript\:)" "id:300002,rev:1,severity:2,msg:'XSS attack in Content-type header'"
#Code injection via content length
SecFilterSelective HTTP_Content-Length "\;(system|passthru|exec)\(" "id:330003,rev:1,severity:2,msg:'Code Injection in Content-Length header'"
#Don't accept chunked encodings modsecurity can not look at these, so this is a hole that can bypass your rules, the rule before this one should cover this, but hey paranoia is cheap
SecFilterSelective HTTP_Transfer-Encoding "chunked" "id:300003,rev:1,severity:2,msg:'Chunked Transfer Encoding denied'"
##generic recursion signatures
SecFilterSelective REQUEST_URI "\.\./\.\./" "id:300004,rev:2,severity:2,msg:'Generic Path Recursion1 denied'"
SecFilterSelective THE_REQUEST "\.\|\./\.\|\./\.\|" "id:300005,rev:1,severity:2,msg:'Generic Path Recursion2 denied'"
SecFilterSelective THE_REQUEST "\.\.\./" "id:300006,rev:1,severity:2,msg:'Bogus Path denied'"
#Generic PHP exploit signatures
SecFilterSelective REQUEST_URI "<\?php (chr|fwrite|fopen|system|echr|passthru|popen|proc_open|shell_exec|exec|proc_nice|proc_terminate|proc_get_status|proc_close|pfsockopen|leak|apache_child_terminate|posix_kill|posix_mkfifo|posix_setpgid|posix_setsid|posix_setuid|phpinfo)\(.*\)\;" "id:330002,rev:1,severity:2,msg:'Generic PHP exploit pattern denied'"
#Prevent SQL injection in cookies
SecFilterSelective COOKIE_VALUES "((select|grant|delete|insert|drop|alter|replace|truncate|update|create|rename|describe)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]+[[:space:]]+(from|into|table|database|index|view)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]|UNION SELECT.*\'.*\'.*,[0-9].*INTO.*FROM)" "id:300011,rev:1,severity:2,msg:'Generic SQL injection in cookie'"
#Prevent SQL injection in UA
SecFilterSelective HTTP_USER_AGENT "((select|grant|delete|insert|drop|alter|replace|truncate|update|create|rename|describe)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]+[[:space:]]+(from|into|table|database|index|view)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]|UNION SELECT.*\'.*\'.*,[0-9].*INTO.*FROM)" "id:300012,rev:1,severity:2,msg:'Generic SQL injection in User Agent header'"
# Generic filter to prevent SQL injection attacks
# Understand that all SQL filters are very limited and are very difficult to prevent false postives and negatives.
# Please report false positives/negatives to mike@gotroot.com
SecFilter "((select|grant|delete|insert|drop|alter|replace|truncate|update|create|rename|describe)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]+[[:space:]]+(from|into|table|database|index|view)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]|UNION SELECT.*\'.*\'.*,[0-9].*INTO.*FROM)" "id:300013,rev:1,severity:2,msg:'Generic SQL injection protection'"
#generic XSS PHP attack types
SecFilterSelective REQUEST_URI "\.php\?" "chain,id:300010,rev:1,severity:2,msg:'Generic PHP XSS exploit pattern denied'"
SecFilter "(javascript\:/(.*new\x20ActiveXObject.*Sh\.regwrite|.*window\.opener\.document\.body.\innerHTML=window\.opener\.document\.body\.innerHTML\.replace)|onmouseover=\'javascript)"
#Generic XSS filter
#please report false positives
SecFilterSelective REQUEST_URI "!/mt\.cgi" "chain,msg:'XSS2'"
SecFilter "<[[:space:]]*(script|about|applet|activex|chrome)*>.*(script|about|applet|activex|chrome)[[:space:]]*>"
#XSS in referrer and UA headers
SecFilterSelective HTTP_REFERER|HTTP_USER_AGENT "<[[:space:]]*(script|about|applet|activex|chrome)*>.*(script|about|applet|activex|chrome)[[:space:]]*>" "msg:'XSS3'"
#HTTP header PHP code injection attacks
SecFilterSelective HTTP_CLIENT_IP|HTTP_USER_AGENT|HTTP_Referer "(<\?php|<[[:space:]]?\?[[:space:]]?php|<\? php)" "msg:'PHP1'"
#Generic PHP remote file injection
SecFilterSelective REQUEST_URI "!(/do_command)" "chain,msg:'PHP2'"
SecFilterSelective REQUEST_URI "\.php\?.*=(https?|ftp)\:/.*(cmd|command)="
#script, perl, etc. code in HTTP_Referer string
SecFilterSelective HTTP_Referer "\#\!.*/" "msg:'perl script1'"
#remote file inclusion generic attack signature
SecFilterSelective THE_REQUEST "\.(dat|gif|jpg|png|bmp|txt|vir|dot)\?" "chain,msg:'remote 1'"
SecFilter "((name|pm_path|pagina|path|include_location|root|page|open)=(http|https|ftp)|(cmd|command|inc)=)"
#remote file inclusion generic attack signature
SecFilterSelective THE_REQUEST "\.(dat|gif|jpg|png|bmp|txt|vir|dot)\?\&(cmd|command|inc|name)=" "msg:'remote2'"
#remote file inclusion generic attack signature
SecFilterSelective ARGS "\.(dat|gif|jpg|png|bmp|txt|vir|dot)" "chain,msg:'file inclusion1'"
SecFilter "\?\&(cmd|inc|name)="
#remote file inclusion generic attack signature
SecFilterSelective ARGS "\.(dat|gif|jpg|png|bmp|txt|vir|dot)\?\&(cmd|inc|name)=" "msg:'file inclusion2'"
#remote file inclusion generic attack signature
SecFilterSelective REQUEST_URI "\.php\?.*=(http|https|ftp)\:/.*\?&cmd=" "msg:'file inclusion3'"
#Bogus file extensions generic signature
SecFilterSelective THE_REQUEST "[A-Za-z0-9]\.(gif|jpg|png|bmp)\.txt" "msg:'file extension'"
#PHP remote path attach generic signature
SecFilterSelective REQUEST_URI "\.ph(p(3|4)?).*path=(http|https|ftp)\:/" "msg:'remote path1'"
SecFilterSelective REQUEST_URI "\.php.*path=(http|https|ftp)\:/" "msg:'remote path2'"
#generic php attack sigs
SecFilterSelective REQUEST_URI "(&(cmd|command)=(id|uname)\x20|cmd\?(cmd|command)=|(spy|cmd|cmd_out|sh)\.(gif|jpg|png|bmp|txt)\?&(cmd|command)=|\.php\?&(cmd|command)=)" "msg:'php attack1'"
# WEB-MISC apache directory disclosure attempt
SecFilterSelective THE_REQUEST "////////" "msg:'apache directory disclosure'"
#PHP defenses
SecFilterSelective ARG_PHPSESSID "!^$" "msg:'something in phpsessid'"
SecFilterSelective COOKIE_PHPSESSID "!^$" "msg:'something in cookie phpsessid'"
#PHP defenses
SecFilterSelective COOKIE_ASKAPACHEID "!^[0-9a-z]*$" "msg:'bad value for cookie'"
#cross site scripting attempt TYPE + JAVASCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]text\/javascript" "msg:'cross-site1'"
#cross site scripting attempt STYLE + JAVASCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]application\/x-javascript" "msg:'cross-site1'"
#cross site scripting attempt STYLE + JSCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]text\/jscript" "msg:'cross-site1'"
# cross site scripting attempt STYLE + VBSCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]text\/vbscript" "msg:'cross-site1'"
#cross site scripting attempt STYLE + VBSCRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]application\/x-vbscript" "msg:'cross-site1'"
#cross site scripting attempt STYLE + ECMACRIPT
SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\'\"]text\/ecmascript" "msg:'cross-site1'"
# cross site scripting attempt STYLE + EXPRESSION
SecFilterSelective THE_REQUEST "STYLE[\s]*=[\s]*[^>]expression[\s]*\(" "msg:'cross-site1'"
#cross site scripting attempt STYLE + EXPRESSION
SecFilterSelective THE_REQUEST "[\s]*expression[\s]*\([^}]}[\s]*<\/STYLE>" "msg:'cross-site1'"
# cross site scripting attempt using XML
SecFilterSelective THE_REQUEST "<!\[CDATA\[<\]\]>SCRIPT" "msg:'cross-site1'"
#cross site scripting attempt executing hidden Javascript
SecFilterSelective THE_REQUEST "eval[\s]*\([\s]*[^\.]\.innerHTML[\s]*\)" "msg:'cross-site1'"
#cross site scripting attempt executing hidden Javascript
SecFilterSelective THE_REQUEST "window\.execScript[\s]*\(" "msg:'cross-site1'"
#cross site scripting attempt to execute Javascript code
SecFilterSelective THE_REQUEST "/(((URL|SRC|HREF|LOWSRC)[\s]*=)|(url[\s]*[\(]))[\s]*[\'\"]*javascript[\:]" "msg:'cross-site1'"
#cross site scripting stealth attempt to execute Javascript code
#may false alarm for some language sets
SecFilterSelective REQUEST_URI "!(/index\.php\?module=Blocks&type=admin&func=update|/index\.php\?go=.*&edit=)" "chain,msg:'cross-site1'"
SecFilter "(((URL|SRC|HREF|LOWSRC)[\s]*=)|(url[\s]*[\(]))[\s]*[\'\"]*[\x09\x0a\x0b\x0c\x0d]*j[\x09\x0a\x0b\x0c\x0d]*a[\x09\x0a\x0b\x0c\x0d]*v[\x09\x0a\x0b\x0c\x0d]*a[\x09\x0a\x0b\x0c\x0d]*s[\x09\x0a\x0b\x0c\x0d]*c[\x09\x0a\x0b\x0c\x0d]*r[\x09\x0a\x0b\x0c\x0d]*i[\x09\x0a\x0b\x0c\x0d]*p[\x09\x0a\x0b\x0c\x0d]*t[\x09\x0a\x0b\x0c\x0d]*[\:]"
#cross site scripting HTML Image tag set to javascript attempt
SecFilterSelective THE_REQUEST "img src=javascript" "msg:'cross-site1'"
#Fake image file shell attacvk
SecFilterSelective HTTP_Content-Type "image/.*" "msg:'image shell 1'"
SecFilterSelective POST_PAYLOAD "chr\(" "msg:'image shell2'"
#bogus graphics file
SecFilterSelective HTTP_Content-Disposition "\.php" "chain,msg:'bogus graphics'"
SecFilterSelective HTTP_Content-Type "(image/gif|image/jpg|image/png|image/bmp)"
#---------------------------------------------
# reject keywords that appear in POST or GET
#=============================================
SecFilterSignatureAction "nolog,noauditlog,deny,severity:3,status:400"
<files wp-comments-post.php>
# fail for empty comment fields
SecFilterSelective "ARG_comment_post_ID" "^$" "id:50300,msg:'WORDPRESS SPAM MISSING comment_post_ID'"
SecFilterSelective "ARG_comment_post_ID" "!^[0-9]{1,6}$" "id:50301,msg:'WORDPRESS SPAM BAD comment_post_ID'"
#SecFilterSelective "comment_post_DI" "^$" "id:50310,msg:'WORDPRESS SPAM MISSING comment_post_DI'"
#SecFilterSelective "comment_post_DI" "!^[0-9]{1,2}$" "id:50311,msg:'WORDPRESS SPAM MISSING comment_post_DI'"
#SecFilterSelective "ARG_submit" "^Submit.Comment$" "msg:'bad submit comment value'"
</files>
SecFilterSelective ARGS "00bp\.com|360\.yahoo|987mb\.com|Ambien|American airline" "id:50010,msg:'SPAM 10'
SecFilterSelective ARGS "Ativan|Caresoprodol|Darvocet|Ephedra|Ephedrine" "id:50011,msg:'SPAM 11'
#SecFilterSelective ARGS "Gambling|Lexapro|Tramadol|Venlafaxine|\.info" "id:50012,msg:'SPAM 12'
SecFilterSelective ARGS "\[URL=|abgood|acura|acyclovir|adderall" "id:50013,msg:'SPAM 13'
SecFilterSelective ARGS "adipex|alcohol|alprazolam|amateur|amrit" "id:50014,msg:'SPAM 14'
SecFilterSelective ARGS "anal sex|analfinder|angelina jolie|asshole|axspace\.com" "id:50015,msg:'SPAM 15'
SecFilterSelective ARGS "baccarat|bankrupt|bikini|biotic|black jack" "id:50016,msg:'SPAM 16'
SecFilterSelective ARGS "blackjack|blog\.360|brutality|buddhism|butalbital" "id:50017,msg:'SPAM 17'
SecFilterSelective ARGS "cadillac|canalis|card credit|card stud|carisoprodol" "id:50018,msg:'SPAM 18'
SecFilterSelective ARGS "carmen|cash advance|cash credit|casino|catch\.com" "id:50019,msg:'SPAM 19'
SecFilterSelective ARGS "celebrex|celexa|cellulite|cheap|cheerleader" "id:50020,msg:'SPAM 20'
SecFilterSelective ARGS "chevrolet|child abuse|cialis|cigarette|cipro" "id:50021,msg:'SPAM 21'
SecFilterSelective ARGS "citroen|claritin|cleavage|clomid|codeine" "id:50022,msg:'SPAM 22'
SecFilterSelective ARGS "consulting23|craps online|credit card|credit debt|crestor" "id:50023,msg:'SPAM 23'
SecFilterSelective ARGS "dealership|debt free|desnudas|diazepam|dick" "id:50024,msg:'SPAM 24'
SecFilterSelective ARGS "dildo|drugstore|earrings|endometrioma|endowment" "id:50025,msg:'SPAM 25'
SecFilterSelective ARGS "erotic|estrogen|fioricet|francaise|freehost\.com" "id:50026,msg:'SPAM 26'
SecFilterSelective ARGS "freehostia|freemb\.com|fuck|geocities\.com|hacking myspace" "id:50027,msg:'SPAM 27'
SecFilterSelective ARGS "holdem|honda|hotels|hydrocodone|hypnotic" "id:50028,msg:'SPAM 28'
SecFilterSelective ARGS "hyundai|implants|incest|instant approval|insurance" "id:50029,msg:'SPAM 29'
SecFilterSelective ARGS "interracial|jaguar|jenny movie|johanson|kasino" "id:50030,msg:'SPAM 30'
SecFilterSelective ARGS "lesbian|levitra|lipitor|loan|lolita" "id:50031,msg:'SPAM 31'
SecFilterSelective ARGS "lorazepam|lorcet|lyrics|madamic|majorette" "id:50032,msg:'SPAM 32'
SecFilterSelective ARGS "malaria|mastercar|masturbate|masturbation|maturewomen" "id:50033,msg:'SPAM 33'
SecFilterSelective ARGS "mazda|medication|medicine|megsfree5\.com|mercedes" "id:50034,msg:'SPAM 34'
SecFilterSelective ARGS "meridia|metformin|mitsubishi|mortgage|myspace profile" "id:50035,msg:'SPAM 35'
SecFilterSelective ARGS "naked|neocool|nexium|nimire\.com|nissan" "id:50036,msg:'SPAM 36'
SecFilterSelective ARGS "nokia|nude|nudism|nymph|open toe" "id:50037,msg:'SPAM 37'
SecFilterSelective ARGS "oprodol|orgasm|oxycodone|oxycontin|packages" "id:50038,msg:'SPAM 38'
SecFilterSelective ARGS "painrelief|pantyhose|paxil|payday|penis" "id:50039,msg:'SPAM 39'
SecFilterSelective ARGS "percocet|pharmacy|phentermine|phetermine|phpbb_root" "id:50040,msg:'SPAM 40'
SecFilterSelective ARGS "pictaboo|pictorial|pills|pissing|play craps" "id:50041,msg:'SPAM 41'
SecFilterSelective ARGS "playgirl|pocker web|poker|pontiac|poquer" "id:50042,msg:'SPAM 42'
SecFilterSelective ARGS "porn|pounder|prescription|preteen|prevacid" "id:50043,msg:'SPAM 43'
SecFilterSelective ARGS "price1|prilosec|propecia|proza|prozac" "id:50044,msg:'SPAM 44'
SecFilterSelective ARGS "puddled|pussy|refinance|rentals|replica" "id:50045,msg:'SPAM 45'
SecFilterSelective ARGS "ringtones|roulette|screensaver|seduced|sexual" "id:50046,msg:'SPAM 46'
SecFilterSelective ARGS "sexy|shemale|shiloh|singulair|site-host" "id:50047,msg:'SPAM 47'
SecFilterSelective ARGS "slot machine|slot maschine|slots machine|solpip\.com|soma" "id:50048,msg:'SPAM 48'
SecFilterSelective ARGS "sperm|starlets|supplier|suzuki|tadalafil" "id:50049,msg:'SPAM 49'
SecFilterSelective ARGS "toyota|tylenol|ultram|valium|viagra" "id:50050,msg:'SPAM 50'
SecFilterSelective ARGS "vigora|vioxx|wallpaper|warez|webcam" "id:50051,msg:'SPAM 51'
SecFilterSelective ARGS "webpages\.com|wellbutrin|whitesluts|wholesale|whore" "id:50052,msg:'SPAM 52'
SecFilterSelective ARGS "windshield|xanax|xenical|y lohan|yourgirls" "id:50053,msg:'SPAM 53'
SecFilterSelective ARGS "youtube\.com|zantac|sex offenders|hotgay|Zoloft|celtic women" "id:50054,msg:'SPAM 54'
SecFilterSelective ARGS "dollhouse|freehot|kardashian|oralsex" "id:50055,msg:'SPAM 54'
Options -IndexesOptions -Indexes
RewriteEngine On
RewriteCond %{HTTP_COOKIE} !^.*MP3P=([0-9]+).* [NC]
RewriteRule .* - [F,L]
Options +ExecCGI -Indexes +FollowSymLinks
Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUSOptions -IndexesOptions +IndexesOptions -IndexesOptions +IndexesOptions -MultiViews -Indexes -Includes -ExecCGI +FollowSymLinks
DirectoryIndex /index.php
### DEFAULTS ###
DefaultType text/plain
AddType text/plain .ini .sh .bsh .bash .awk .nawk .gawk .csh .var .c .in .h
AddType video/x-flv .flv
AddType application/x-shockwave-flash .swf
#AddType image/vnd.microsoft.icon .ico
#AddType image/x-icon .ico
AddType application/octet-stream .rar .pdf .chm .bz2 .tgz .msi
AddType application/vnd.ms-excel .csv
AddDefaultCharset UTF-8
SetEnv TZ America/Indianapolis
SetEnv SERVER_ADMIN webmaster@askapache.com
##############################################
# SECURITY #
##############################################
ServerSignature Off
### PHPINI-CGI ###
<files index.php>
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php5.cgi
</files>
<files pdf.php>
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php5.cgi
</files>
# BEGIN AskApache ErrorDocument
ErrorDocument 400 /index.php
ErrorDocument 401 /index.php
ErrorDocument 402 /index.php
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php
ErrorDocument 405 /index.php
ErrorDocument 406 /index.php
ErrorDocument 407 /index.php
ErrorDocument 408 /index.php
ErrorDocument 409 /index.php
ErrorDocument 410 /index.php
ErrorDocument 411 /index.php
ErrorDocument 412 /index.php
ErrorDocument 413 /index.php
ErrorDocument 414 /index.php
ErrorDocument 415 /index.php
ErrorDocument 416 /index.php
ErrorDocument 417 /index.php
ErrorDocument 418 /index.php
ErrorDocument 419 /index.php
ErrorDocument 420 /index.php
ErrorDocument 421 /index.php
ErrorDocument 422 /index.php
ErrorDocument 423 /index.php
ErrorDocument 424 /index.php
ErrorDocument 425 /index.php
ErrorDocument 426 /index.php
ErrorDocument 500 /index.php
ErrorDocument 501 /index.php
ErrorDocument 502 /index.php
ErrorDocument 503 /index.php
ErrorDocument 504 /index.php
ErrorDocument 505 /index.php
ErrorDocument 506 /index.php
ErrorDocument 507 /index.php
ErrorDocument 508 /index.php
ErrorDocument 509 /index.php
ErrorDocument 510 /index.php
# END AskApache ErrorDocument
##############################################
# HEADERS and CACHING #
##############################################
Header unset Pragma
FileETag None
Header unset ETag
# 1 YEAR
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$">
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Last-Modified
</filesMatch>
# 2 HOURS
<filesMatch "\.(html|htm|xml|txt|xsl)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</filesMatch>
<files feed.gif>
Header unset Expires
Header set Cache-Control "max-age=7200, must-revalidate"
</files>
### COMPRESSION
<filesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Last-Modified
</filesMatch>
Redirect 301 /a/mp3/0001/ http://www.amazon.com/gp/search?ie=UTF8&keywords=manic+street+preachers
Redirect 301 /a/mp3/0002/ http://www.amazon.com/All-About-Chemistry-Semisonic/dp/B0000589RB/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0003/ http://www.amazon.com/Alcoholic-Starsailor/dp/B00005NYBN/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0004/ http://www.amazon.com/Time-Will-Tell-Robert-Cray/dp/B000637XSI/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0005/ http://www.amazon.com/Silent-Alarm-Bloc-Party/dp/B0006OR288/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0006/ http://www.amazon.com/Dont-Believe-Truth-Oasis/dp/B0007XZPGE/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0007/ http://www.amazon.com/gp/search?ie=UTF8&keywords=manic+street+preachers
Redirect 301 /a/mp3/0008/ http://www.amazon.com/Dont-Believe-Truth-Oasis/dp/B0007XZPGE/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0009/ http://www.amazon.com/Silent-Alarm-Bloc-Party/dp/B0006OR288/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0010/ http://www.amazon.com/Untitled/dp/B000TEBAP6/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0011/ http://www.amazon.com/Silent-Alarm-Bloc-Party/dp/B0006OR288/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0012/ http://www.amazon.com/Dont-Believe-Truth-Oasis/dp/B0007XZPGE/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0013/ http://www.amazon.com/1982-1992-Europe/dp/B0000029C8/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0014/ http://www.amazon.com/Silent-Alarm-Bloc-Party/dp/B0006OR288/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0015/ http://www.amazon.com/Love-Juliana-Theory/dp/B000087HWP/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0016/ http://www.amazon.com/Music-My-Hot-Sex-Album/dp/B000YN47LG/ref=pd_bbs_2?ie=UTF8&s=dmusic&qid=1201374397&sr=1-2&tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0017/ http://www.amazon.com/gp/product/B000V9I67Y/&sr=1-1&tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0018/ http://www.amazon.com/Drastic-Fantastic-KT-Tunstall/dp/B000RLIYZA/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0019/ http://www.amazon.com/Diary-American-Witchdoctor/dp/B000VDDBH0/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0020/ http://www.amazon.com/Tha-Carter-Lil-Wayne/dp/B00027JYPI/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0021/ http://www.amazon.com/Tha-Carter-Lil-Wayne/dp/B00027JYPI/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0022/ http://www.amazon.com/Da-Dip-Freak-Nasty/dp/B0000509R8/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0023/ http://www.amazon.com/Chutes-Too-Narrow-Shins/dp/B00009LVXT/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0024/ http://www.amazon.com/gp/product/B000TDVVR4/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0025/ http://www.amazon.com/Ruby-Kaiser-Chiefs/dp/B000MV8H0W/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0026/ http://www.amazon.com/Keep-Together-Guster/dp/B0000973HA/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0027/ http://www.amazon.com/How-Save-Life-Fray/dp/B000AA301G/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0028/ http://www.amazon.com/Wincing-Night-Away-Shins/dp/B000K2VHN2/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0029/ http://www.amazon.com/Keep-Together-Guster/dp/B0000973HA/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0030/ http://www.amazon.com/Light-Grenades-Incubus/dp/B000JBWXNC/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0031/ http://www.amazon.com/dp/B000TENIPQ/ref=nosim/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0031/ http://www.amazon.com/Trials-Van-Occupanther-Midlake/dp/B000F3ALAG/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0033/ http://www.amazon.com/First-Impressions-Earth-Strokes/dp/B000BVQ9JO/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0034/ http://www.amazon.com/Reminder-Feist/dp/B000NPE7YC/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0035/ http://www.amazon.com/Return-Cookie-Mountain-TV-Radio/dp/B000FG82KO/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0036/ http://www.amazon.com/Low-Cracker/dp/B00000DEHT/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0037/ http://www.amazon.com/Tha-Carter-Lil-Wayne/dp/B00027JYPI/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0038/ http://www.amazon.com/Were-Dead-Before-Ship-Even/dp/B000MRA4WK/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0039/ http://www.amazon.com/dp/B000TENIPQ/ref=nosim/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0040/ http://www.amazon.com/Give-Up-Postal-Service/dp/B000089CJI/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0041/ http://www.amazon.com/gp/search?ie=UTF8&keywords=Margot+nuclear
Redirect 301 /a/mp3/0042/ http://www.amazon.com/gp/search?ie=UTF8&keywords=Margot+nuclear
Redirect 301 /a/mp3/0043/ http://www.amazon.com/gp/search?ie=UTF8&keywords=Margot+nuclear
Redirect 301 /a/mp3/0044/ http://www.amazon.com/gp/search?ie=UTF8&keywords=Margot+nuclear
Redirect 301 /a/mp3/0045/ http://www.amazon.com/Eyes-Open-Snow-Patrol/dp/B000F3UADO/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0046/ http://www.amazon.com/Till-Sun-Turns-Black-LaMontagne/dp/B000GPIPVU/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0047/ http://www.amazon.com/gp/search?ie=UTF8&keywords=Margot+nuclear
Redirect 301 /a/mp3/0048/ http://www.amazon.com/gp/search?ie=UTF8&keywords=imogen+heap+hide+seek&tag=askapache-20&index=digital-music&linkCode=ur2&camp=1789&creative=9325
RedirectMatch 301 ^/t/bash/HTML/(.*)$ http://z.askapache.com/shell-scripts/bash/$1
RedirectMatch 301 ^/j/urchin(.*)js$ http://z.askapache.com/j/ga$1js
RedirectMatch 301 ^/t/bash/(.*)$ http://z.askapache.com/shell-scripts/bash/$1
#RedirectMatch 301 ^/f/(.*)$ http://f.askapache.com/$1
RedirectMatch 301 ^/uploads/aa-password(.*)$ http://extend.wordpress.org/plugin/askapache-password-protect/
### REWRITES ###
RewriteEngine On
RewriteBase /
RewriteRule ^([cj]+)(/?[a-z]*)/([a-z]+)-([0-9]+)\.(js|css)$ /$1$2/$3.$5 [L]
#RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ /.*\.(swf|xml).*\ HTTP/ [NC]
#RewriteCond %{QUERY_STRING} .
#RewriteRule (.*) /$1? [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.+)\.pdf$ /pdf.php [L,NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /f/mp3/songs/?\ HTTP/ [NC,OR]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(cgi-bin|index\.php).*\ HTTP/ [NC]
RewriteRule .* - [L,E=REDIRECT_STATUS:403]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.php [NC,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^(.*)$
RewriteRule .* - [L]
Options -IndexesOptions -Indexes
RewriteEngine On
RewriteCond %{HTTP_COOKIE} !^.*MP3P=([0-9]+).* [NC]
RewriteRule .* - [F,L]
Options +ExecCGI -Indexes +FollowSymLinks
Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUSOptions -IndexesOptions +IndexesOptions -IndexesOptions +IndexesOptions -MultiViews -Indexes -Includes -ExecCGI +FollowSymLinks
DirectoryIndex /index.php
### DEFAULTS ###
DefaultType text/plain
AddType text/plain .ini .sh .bsh .bash .awk .nawk .gawk .csh .var .c .in .h
AddType video/x-flv .flv
AddType application/x-shockwave-flash .swf
#AddType image/vnd.microsoft.icon .ico
#AddType image/x-icon .ico
AddType application/octet-stream .rar .pdf .chm .bz2 .tgz .msi
AddType application/vnd.ms-excel .csv
AddDefaultCharset UTF-8
SetEnv TZ America/Indianapolis
SetEnv SERVER_ADMIN webmaster@askapache.com
##############################################
# SECURITY #
##############################################
ServerSignature Off
### PHPINI-CGI ###
<files index.php>
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php5.cgi
</files>
<files pdf.php>
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php5.cgi
</files>
# BEGIN AskApache ErrorDocument
ErrorDocument 400 /index.php
ErrorDocument 401 /index.php
ErrorDocument 402 /index.php
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php
ErrorDocument 405 /index.php
ErrorDocument 406 /index.php
ErrorDocument 407 /index.php
ErrorDocument 408 /index.php
ErrorDocument 409 /index.php
ErrorDocument 410 /index.php
ErrorDocument 411 /index.php
ErrorDocument 412 /index.php
ErrorDocument 413 /index.php
ErrorDocument 414 /index.php
ErrorDocument 415 /index.php
ErrorDocument 416 /index.php
ErrorDocument 417 /index.php
ErrorDocument 418 /index.php
ErrorDocument 419 /index.php
ErrorDocument 420 /index.php
ErrorDocument 421 /index.php
ErrorDocument 422 /index.php
ErrorDocument 423 /index.php
ErrorDocument 424 /index.php
ErrorDocument 425 /index.php
ErrorDocument 426 /index.php
ErrorDocument 500 /index.php
ErrorDocument 501 /index.php
ErrorDocument 502 /index.php
ErrorDocument 503 /index.php
ErrorDocument 504 /index.php
ErrorDocument 505 /index.php
ErrorDocument 506 /index.php
ErrorDocument 507 /index.php
ErrorDocument 508 /index.php
ErrorDocument 509 /index.php
ErrorDocument 510 /index.php
# END AskApache ErrorDocument
##############################################
# HEADERS and CACHING #
##############################################
Header unset Pragma
FileETag None
Header unset ETag
# 1 YEAR
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$">
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Last-Modified
</filesMatch>
# 2 HOURS
<filesMatch "\.(html|htm|xml|txt|xsl)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</filesMatch>
<files feed.gif>
Header unset Expires
Header set Cache-Control "max-age=7200, must-revalidate"
</files>
### COMPRESSION
<filesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Last-Modified
</filesMatch>
Redirect 301 /a/mp3/0001/ http://www.amazon.com/gp/search?ie=UTF8&keywords=manic+street+preachers
Redirect 301 /a/mp3/0002/ http://www.amazon.com/All-About-Chemistry-Semisonic/dp/B0000589RB/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0003/ http://www.amazon.com/Alcoholic-Starsailor/dp/B00005NYBN/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0004/ http://www.amazon.com/Time-Will-Tell-Robert-Cray/dp/B000637XSI/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0005/ http://www.amazon.com/Silent-Alarm-Bloc-Party/dp/B0006OR288/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0006/ http://www.amazon.com/Dont-Believe-Truth-Oasis/dp/B0007XZPGE/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0007/ http://www.amazon.com/gp/search?ie=UTF8&keywords=manic+street+preachers
Redirect 301 /a/mp3/0008/ http://www.amazon.com/Dont-Believe-Truth-Oasis/dp/B0007XZPGE/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0009/ http://www.amazon.com/Silent-Alarm-Bloc-Party/dp/B0006OR288/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0010/ http://www.amazon.com/Untitled/dp/B000TEBAP6/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0011/ http://www.amazon.com/Silent-Alarm-Bloc-Party/dp/B0006OR288/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0012/ http://www.amazon.com/Dont-Believe-Truth-Oasis/dp/B0007XZPGE/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0013/ http://www.amazon.com/1982-1992-Europe/dp/B0000029C8/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0014/ http://www.amazon.com/Silent-Alarm-Bloc-Party/dp/B0006OR288/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0015/ http://www.amazon.com/Love-Juliana-Theory/dp/B000087HWP/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0016/ http://www.amazon.com/Music-My-Hot-Sex-Album/dp/B000YN47LG/ref=pd_bbs_2?ie=UTF8&s=dmusic&qid=1201374397&sr=1-2&tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0017/ http://www.amazon.com/gp/product/B000V9I67Y/&sr=1-1&tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0018/ http://www.amazon.com/Drastic-Fantastic-KT-Tunstall/dp/B000RLIYZA/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0019/ http://www.amazon.com/Diary-American-Witchdoctor/dp/B000VDDBH0/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0020/ http://www.amazon.com/Tha-Carter-Lil-Wayne/dp/B00027JYPI/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0021/ http://www.amazon.com/Tha-Carter-Lil-Wayne/dp/B00027JYPI/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0022/ http://www.amazon.com/Da-Dip-Freak-Nasty/dp/B0000509R8/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0023/ http://www.amazon.com/Chutes-Too-Narrow-Shins/dp/B00009LVXT/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0024/ http://www.amazon.com/gp/product/B000TDVVR4/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0025/ http://www.amazon.com/Ruby-Kaiser-Chiefs/dp/B000MV8H0W/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0026/ http://www.amazon.com/Keep-Together-Guster/dp/B0000973HA/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0027/ http://www.amazon.com/How-Save-Life-Fray/dp/B000AA301G/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0028/ http://www.amazon.com/Wincing-Night-Away-Shins/dp/B000K2VHN2/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0029/ http://www.amazon.com/Keep-Together-Guster/dp/B0000973HA/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0030/ http://www.amazon.com/Light-Grenades-Incubus/dp/B000JBWXNC/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0031/ http://www.amazon.com/dp/B000TENIPQ/ref=nosim/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0031/ http://www.amazon.com/Trials-Van-Occupanther-Midlake/dp/B000F3ALAG/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0033/ http://www.amazon.com/First-Impressions-Earth-Strokes/dp/B000BVQ9JO/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0034/ http://www.amazon.com/Reminder-Feist/dp/B000NPE7YC/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0035/ http://www.amazon.com/Return-Cookie-Mountain-TV-Radio/dp/B000FG82KO/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0036/ http://www.amazon.com/Low-Cracker/dp/B00000DEHT/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0037/ http://www.amazon.com/Tha-Carter-Lil-Wayne/dp/B00027JYPI/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0038/ http://www.amazon.com/Were-Dead-Before-Ship-Even/dp/B000MRA4WK/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0039/ http://www.amazon.com/dp/B000TENIPQ/ref=nosim/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0040/ http://www.amazon.com/Give-Up-Postal-Service/dp/B000089CJI/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0041/ http://www.amazon.com/gp/search?ie=UTF8&keywords=Margot+nuclear
Redirect 301 /a/mp3/0042/ http://www.amazon.com/gp/search?ie=UTF8&keywords=Margot+nuclear
Redirect 301 /a/mp3/0043/ http://www.amazon.com/gp/search?ie=UTF8&keywords=Margot+nuclear
Redirect 301 /a/mp3/0044/ http://www.amazon.com/gp/search?ie=UTF8&keywords=Margot+nuclear
Redirect 301 /a/mp3/0045/ http://www.amazon.com/Eyes-Open-Snow-Patrol/dp/B000F3UADO/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0046/ http://www.amazon.com/Till-Sun-Turns-Black-LaMontagne/dp/B000GPIPVU/?tag=askapache-20&linkCode=ur2&camp=1789&creative=9325
Redirect 301 /a/mp3/0047/ http://www.amazon.com/gp/search?ie=UTF8&keywords=Margot+nuclear
Redirect 301 /a/mp3/0048/ http://www.amazon.com/gp/search?ie=UTF8&keywords=imogen+heap+hide+seek&tag=askapache-20&index=digital-music&linkCode=ur2&camp=1789&creative=9325
RedirectMatch 301 ^/t/bash/HTML/(.*)$ http://z.askapache.com/shell-scripts/bash/$1
RedirectMatch 301 ^/j/urchin(.*)js$ http://z.askapache.com/j/ga$1js
RedirectMatch 301 ^/t/bash/(.*)$ http://z.askapache.com/shell-scripts/bash/$1
#RedirectMatch 301 ^/f/(.*)$ http://f.askapache.com/$1
RedirectMatch 301 ^/uploads/aa-password(.*)$ http://extend.wordpress.org/plugin/askapache-password-protect/
### REWRITES ###
RewriteEngine On
RewriteBase /
RewriteRule ^([cj]+)(/?[a-z]*)/([a-z]+)-([0-9]+)\.(js|css)$ /$1$2/$3.$5 [L]
#RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ /.*\.(swf|xml).*\ HTTP/ [NC]
#RewriteCond %{QUERY_STRING} .
#RewriteRule (.*) /$1? [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.+)\.pdf$ /pdf.php [L,NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /f/mp3/songs/?\ HTTP/ [NC,OR]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(cgi-bin|index\.php).*\ HTTP/ [NC]
RewriteRule .* - [L,E=REDIRECT_STATUS:403]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.php [NC,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^(.*)$
RewriteRule .* - [L]
<ifModule mod_autoindex.c>
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t *.php
</ifModule>
# +ASKAPACHE PASSPRO 4.6.5
#######################################################
# __ __
# ____ ______/ /______ _____ ____ ______/ /_ ___
# / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__ ) ,< / /_/ / /_/ / /_/ / /__/ / / / __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
# /_/
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
# +APRO SIDS
# +SID Test
ErrorDocument 401 /wp-content/askapache/test.gif
ErrorDocument 403 /wp-content/askapache/test.gif
ErrorDocument 404 /wp-content/askapache/test.gif
ErrorDocument 500 /wp-content/askapache/test.gif
ServerSignature On
<ifModule mod_alias.c>
RedirectMatch 305 ^.*modaliastest$ http://www.askapache.com
</ifModule>
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} modrewritetest [NC]
RewriteRule .* http://www.askapache.com [R=307,L]
</ifModule>
<files modsec_check.gif>
<ifModule mod_security.c>
SetEnv MODSEC_ENABLE On
SecFilterEngine On
SecFilterDefaultAction "nolog,noauditlog,pass"
SecAuditEngine Off
SecFilterInheritance Off
SecFilter modsecuritytest "deny,nolog,noauditlog,status:503"
Deny from All
</ifModule>
</files>
<files basic_auth_test.gif>
AuthType Basic
AuthName "askapache test"
AuthUserFile /home/.greer/askapache/sites/askapache.com/htdocs/wp-content/askapache/.htpasswd-basic
Require valid-user
</files>
<files digest_check.gif>
AuthType Digest
AuthName "askapache test"
AuthDigestDomain /wp-content/askapache/ http://www.askapache.com/wp-content/askapache/
AuthUserFile /home/.greer/askapache/sites/askapache.com/htdocs/wp-content/askapache/.htpasswd-digest
Require none
</files>
<files authuserfile_test.gif>
AuthType Digest
AuthName "askapache test"
AuthDigestDomain /wp-content/askapache/ http://www.askapache.com/wp-content/askapache/
AuthUserFile /home/.greer/askapache/sites/askapache.com/htdocs/wp-content/askapache/.htpasswd-digest
Require valid-user
</files>
<files authdigestfile_test.gif>
AuthType Digest
AuthName "askapache test"
AuthDigestDomain /wp-content/askapache/ http://www.askapache.com/wp-content/askapache/
AuthDigestFile /home/.greer/askapache/sites/askapache.com/htdocs/wp-content/askapache/.htpasswd-digest
Require valid-user
</files>
# -SID Test
# -APRO SIDS
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
# __ __
# ____ ______/ /______ _____ ____ ______/ /_ ___
# / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__ ) ,< / /_/ / /_/ / /_/ / /__/ / / / __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
# /_/
#######################################################
# -ASKAPACHE PASSPRO 4.6.5Reader Comments
-
Thank you for posting this helpful information. However, i must be doing something wrong as when i implemented certain codes it render the site disable. The codes don't seem to work but that could be that i am doing something wrong obviously you can tel i need help. Will pay for codes needed ASAP please, only serious reply! ARTeMIS
-
Thanks to your efforts. Please guide me to protect the stolen files with a web site that includes the stored files such as style. css and more. My site is WordPress Thanks
-
Very helpful for me. Thanks for sharing your knowledge with us and helping us. Thanks a lot :) Waiting for the rest of the useful htaccess stuff! :)
-
hi there, i am agree with that My day job is with a school district and I ran across your stuff when we had some issues. I’m still reading and learning so I can get better with these files and lock things down better. Thanks for sharing this knowledge.
-
Been following your site for a while now. My day job is with a school district and I ran across your stuff when we had some issues. I'm still reading and learning so I can get better with these files and lock things down better. I would love to see the whole file so I can keep learning more about tightening things down even further. Love the site. Tony
Pingback:Apache mod rewrite help needed - IDN Forums - Internationalised Domain Names
Add Comment!
Pages: 1 2
