Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <IfModule mod_security.c>
- SecFilterEngine Off
- SecFilterScanPOST Off
- </IfModule>
- <IfModule mod_security.c>
- <Files async-upload.php>
- SecFilterEngine Off
- SecFilterScanPOST Off
- </Files>
- </IfModule>
- # ----------------------------------------------------------------------
- # Better website experience for IE users
- # ----------------------------------------------------------------------
- # Force the latest IE version, in various cases when it may fall back to IE7 mode
- # github.com/rails/rails/commit/123eb25#commitcomment-118920
- # Use ChromeFrame if it's installed for a better experience for the poor IE folk
- <IfModule mod_headers.c>
- Header set X-UA-Compatible "IE=Edge,chrome=1"
- # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
- <FilesMatch "\.(appcache|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svg|svgz|ttf|vcf|webm|webp|woff|xml|xpi)$">
- Header unset X-UA-Compatible
- </FilesMatch>
- </IfModule>
- # ----------------------------------------------------------------------
- # CORS-enabled images (@crossorigin)
- # ----------------------------------------------------------------------
- # Send CORS headers if browsers request them; enabled by default for images.
- # developer.mozilla.org/en/CORS_Enabled_Image
- # blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
- # hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/
- # wiki.mozilla.org/Security/Reviews/crossoriginAttribute
- <IfModule mod_setenvif.c>
- <IfModule mod_headers.c>
- # mod_headers, y u no match by Content-Type?!
- <FilesMatch "\.(gif|ico|jpe?g|png|svg|svgz|webp)$">
- SetEnvIf Origin ":" IS_CORS
- Header set Access-Control-Allow-Origin "*" env=IS_CORS
- </FilesMatch>
- </IfModule>
- </IfModule>
- # ----------------------------------------------------------------------
- # Webfont access
- # ----------------------------------------------------------------------
- # Allow access from all domains for webfonts.
- # Alternatively you could only whitelist your
- # subdomains like "subdomain.example.com".
- <IfModule mod_headers.c>
- <FilesMatch "\.(eot|font.css|otf|ttc|ttf|woff)$">
- Header set Access-Control-Allow-Origin "*"
- </FilesMatch>
- </IfModule>
- #disable the server signature
- ServerSignature Off
- #Prevent folder browsing
- Options All -Indexes
- #Remove PHP Version
- <ifModule mod_headers.c>
- Header unset X-Powered-By
- Header unset Server
- </IfModule>
- #PROTECT wp-config.php
- <files wp-config.php>
- Order deny,allow
- deny from all
- </files>
- #PROTECT readme.html
- <files readme.html>
- Order deny,allow
- deny from all
- </files>
- #PROTECT wp-config-sample.php
- <files wp-config-sample.php>
- Order Allow,Deny
- Deny from all
- Satisfy all
- </files>
- #PROTECT install.php
- <Files install.php>
- Order Allow,Deny
- Deny from all
- Satisfy all
- </Files>
- #Protect the .htaccess
- <files .htaccess="">
- order allow,deny
- deny from all
- </files>
- <Files ~ "^.*\.([Hh][Tt][Aa])">
- order allow,deny
- deny from all
- satisfy all
- </Files>
- #Fav ico
- <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteBase /
- RewriteCond %{REQUEST_URI} !^/icon.ico$ [NC]
- RewriteCond %{REQUEST_URI} /favicon(s)?\.?(gif|ico|jpe?g?|png)?$ [NC]
- RewriteRule (.*) /icon.ico [R=301,L]
- </IfModule>
- #Robots
- <IfModule mod_rewrite.c>
- RewriteBase /
- RewriteCond %{REQUEST_URI} !^/robots.txt$ [NC]
- RewriteCond %{REQUEST_URI} robots\.txt [NC]
- RewriteRule .* /robots.txt [R=301,L]
- </IfModule>
- #Redirect wp
- <IfModule mod_alias.c>
- RedirectMatch 301 ^/tag/$ http://any-domain-of-multisite-.com/
- RedirectMatch 301 ^/search/$ http://any-domain-of-multisite-.com/
- RedirectMatch 301 ^/category/$ http://any-domain-of-multisite-.com/
- </IfModule>
- # Drop problematic browsers
- BrowserMatch ^Mozilla/4 gzip-only-text/html
- BrowserMatch ^Mozilla/4\.0[678] no-gzip
- BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
- # Make sure proxies don't deliver the wrong content
- Header append Vary User-Agent env=!dont-vary
- </IfModule>
- # BEGIN feedburner and uploaded files adjustments.
- <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteCond %{HTTP_USER_AGENT} !^.*(FeedBurner|FeedValidator) [NC]
- RewriteRule ^feed/?.*$ http://feeds.feedburner.com/domain1 [L,NC,R=302]
- RewriteRule ^home?.*$ http://feeds.feedburner.com/domain1 [L,NC,R=301]
- </IfModule>
- # 5G BLACKLIST/FIREWALL (2013)
- # @ http://perishablepress.com/5g-blacklist-2013/
- # 5G:[USER AGENTS]
- <IfModule mod_setenvif.c>
- # SetEnvIfNoCase User-Agent ^$ keep_out
- SetEnvIfNoCase User-Agent (binlar|casper|cmsworldmap|comodo|diavol|dotbot|feedfinder|flicky|jakarta|kmccrew|nutch|planetwork|purebot|pycurl|skygrid|sucker|turnit|vikspider|zmeu) keep_out
- <limit GET POST PUT>
- Order Allow,Deny
- Allow from all
- Deny from env=keep_out
- </limit>
- </IfModule>
- # 5G:[REQUEST METHOD]
- <ifModule mod_rewrite.c>
- RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
- RewriteRule .* - [F]
- </IfModule>
- # 5G:[BAD IPS]
- <limit GET POST PUT>
- Order Allow,Deny
- Allow from all
- # uncomment/edit/repeat next line to block IPs
- # Deny from 123.456.789
- </limit>
- #BEGIN ANTISPAMBLOG REGISTRATION
- RewriteCond %{HTTP_COOKIE} !^.*97674d05a6fcf467b8e51dc408cd1163.*$
- RewriteRule ^wp-signup.php - [F,L]
- # BEGIN Watermark Hotlinked Images
- <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteCond %{HTTP_REFERER} !^$
- RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?domain1.com [NC]
- RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?feeds.feedburner.com/domain1 [NC]
- RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?domain2.com [NC]
- RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?domain3.com [NC]
- RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?domain4.com [NC]
- RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?google.\ [NC]
- RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?facebook.com [NC]
- RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?twitter.com [NC]
- RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?yahoo.\ [NC]
- RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?bing.\ [NC]
- RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?ixquick.com [NC]
- RewriteRule ^(.*\.(png|gif|jpe?g))$ /wp-content/plugins/watermark-hotlinked-images/watermark.php?img=$1 [L]
- #Compress
- # Remove ETags
- FileETag None
- <ifModule mod_headers.c>
- Header set Connection keep-alive
- </ifModule>
- # This .htaccess file is used to speed up this website
- # See https://github.com/sergeychernyshev/.htaccess
- # ----------------------------------------------------------------------
- # Proper MIME type for all files
- #
- # Copied from the HTML5 boilerplate project's .htaccess file
- # https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess
- # ----------------------------------------------------------------------
- # JavaScript
- # Normalize to standard type (it's sniffed in IE anyways)
- # tools.ietf.org/html/rfc4329#section-7.2
- AddType application/javascript .js .jsonp
- AddType application/json .json
- # Audio
- AddType audio/ogg .oga .ogg
- AddType audio/mp4 .m4a .f4a .f4b
- # Video
- AddType video/ogg .ogv
- AddType video/mp4 .mp4 .m4v .f4v .f4p
- AddType video/webm .webm
- AddType video/x-flv .flv
- # SVG
- # Required for svg webfonts on iPad
- # twitter.com/FontSquirrel/status/14855840545
- AddType image/svg+xml .svg .svgz
- AddEncoding .gzip .svgz
- # Webfonts
- AddType application/vnd.ms-fontobject .eot
- AddType font/ttf .ttf
- AddType font/otf .otf
- AddType application/x-font-woff .woff
- # Assorted types
- AddType image/x-icon .ico
- AddType image/webp .webp
- AddType text/cache-manifest .appcache manifest
- AddType text/x-component .htc
- AddType application/xml .rss .atom .xml .rdf
- AddType application/x-chrome-extension .crx
- AddType application/x-opera-extension .oex
- AddType application/x-xpinstall .xpi
- AddType application/octet-stream .safariextz
- AddType application/x-web-app-manifest+json .webapp
- AddType text/x-vcard .vcf
- AddType application/x-shockwave-flash .swf
- AddType text/vtt .vtt
- # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
- <IfModule mod_setenvif.c>
- <IfModule mod_headers.c>
- SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
- RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
- </IfModule>
- </IfModule>
- # --------------------------------------------------------------------------------------
- # Compression: http://code.google.com/speed/page-speed/docs/payload.html#GzipCompression
- # --------------------------------------------------------------------------------------
- <IfModule mod_deflate.c>
- AddOutputFilterByType DEFLATE application/atom+xml
- AddOutputFilterByType DEFLATE application/json
- AddOutputFilterByType DEFLATE application/xhtml+xml
- AddOutputFilterByType DEFLATE application/xml
- AddOutputFilterByType DEFLATE text/css
- AddOutputFilterByType DEFLATE text/html
- AddOutputFilterByType DEFLATE text/plain
- AddOutputFilterByType DEFLATE text/x-component
- AddOutputFilterByType DEFLATE text/xml
- # The following MIME types are in the process of registration
- AddOutputFilterByType DEFLATE application/xslt+xml
- AddOutputFilterByType DEFLATE image/svg+xml
- # The following MIME types are NOT registered
- AddOutputFilterByTypeByType DEFLATE application/mathml+xml
- AddOutputFilterByTypeByType DEFLATE application/rss+xml
- # JavaScript has various MIME types
- AddOutputFilterByType DEFLATE application/javascript
- AddOutputFilterByType DEFLATE application/x-javascript
- AddOutputFilterByType DEFLATE text/ecmascript
- AddOutputFilterByType DEFLATE text/javascript
- # .ico files and other compressible images
- AddOutputFilterByType DEFLATE image/vnd.microsoft.icon
- AddOutputFilterByType DEFLATE image/x-icon
- AddOutputFilterByType DEFLATE image/bmp
- AddOutputFilterByType DEFLATE image/tiff
- AddOutputFilterByType DEFLATE application/pdf
- # compressible fonts (.woff is already compressed)
- AddOutputFilterByType DEFLATE font/opentype
- AddOutputFilterByType DEFLATE application/x-font-ttf
- AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
- </IfModule>
- # ----------------------------------------------------------------------
- # Enabling filename rewriting (file.XXX.ext) if URL rewriting is enabled
- # Otherwise URLs will use query strings (file.ext?v=XXX)
- #
- # More proxies cache assets if there is no query string
- # ----------------------------------------------------------------------
- <IfModule mod_rewrite.c>
- RewriteEngine On
- # Setting up an environment variable so your code can detect if mod_rewrite rules are executable
- # in this folder and you can use file.123.jpg or you need to fall back to file.jpg?123
- RewriteRule . - [E=URLVERSIONREWRITE:YES]
- # Rewrites a version in file.123.jpg as well as timestamped version file.123_m_12345123512354.jpg
- # to original file.jpg so you can use it instead of file.jpg?123 which isn't cached in some proxies.
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule ^(.*)\.(\d+)(_m_\d+)?\.([^\.]+)$ $1.$4 [L,QSA]
- # Rewrites a version in file.ac123fe.jpg to original file.jpg
- # so you can use it instead of file.jpg?123 which isn't cached in some proxies.
- # Used for hash-based URLs where having a timestamp is not necessary.
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule ^(.*)\.([a-z\d]+)\.([^\.]+)$ $1.$3 [L,QSA]
- </IfModule>
- # ----------------------------------------------------------------------
- # Expires headers (for better cache control)
- # ----------------------------------------------------------------------
- # These are pretty far-future expires headers.
- # They assume you control versioning with filename-based cache busting
- # Additionally, consider that outdated proxies may miscache
- # www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
- # If you don't use filenames to version, lower the CSS and JS to something like
- # "access plus 1 week".
- <IfModule mod_expires.c>
- ExpiresActive on
- # Perhaps better to whitelist expires rules? Perhaps.
- ExpiresDefault "access plus 1 month"
- # cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
- ExpiresByType text/cache-manifest "access plus 0 seconds"
- # Your document html
- ExpiresByType text/html "access plus 0 seconds"
- # Data
- ExpiresByType application/json "access plus 0 seconds"
- ExpiresByType application/xml "access plus 0 seconds"
- ExpiresByType text/xml "access plus 0 seconds"
- ExpiresByType application/pdf "access plus 1 year"
- ExpiresByType application/x-shockwave-flash "access plus 1 year"
- # Feed
- ExpiresByType application/atom+xml "access plus 1 hour"
- ExpiresByType application/rss+xml "access plus 1 hour"
- ExpiresByType application/mathml+xml "access plus 1 year"
- ExpiresByType application/xslt+xml "access plus 1 year"
- # Favicon (cannot be renamed)
- ExpiresByType image/x-icon "access plus 1 year"
- # Media: images, video, audio
- ExpiresByType image/bmp "access plus 1 year"
- ExpiresByType image/gif "access plus 1 year"
- ExpiresByType image/jpeg "access plus 1 year"
- ExpiresByType image/png "access plus 1 year"
- ExpiresByType image/svg+xml "access plus 1 year"
- ExpiresByType image/tiff "access plus 1 year"
- ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
- ExpiresByType video/x-flv "access plus 1 year"
- ExpiresByType image/webp "access plus 1 year"
- ExpiresByType video/mp4 "access plus 1 year"
- ExpiresByType video/ogg "access plus 1 year"
- ExpiresByType video/webm "access plus 1 year"
- ExpiresByType audio/ogg "access plus 1 year"
- # HTC files (css3pie)
- ExpiresByType text/x-component "access plus 1 month"
- # Webfonts
- ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
- ExpiresByType application/x-font-ttf "access plus 1 year"
- ExpiresByType application/x-font-woff "access plus 1 year"
- ExpiresByType application/font-woff "access plus 1 year"
- ExpiresByType font/opentype "access plus 1 year"
- ExpiresByType image/svg+xml "access plus 1 year"
- # CSS and JavaScript
- ExpiresByType application/x-javascript "access plus 1 year"
- ExpiresByType application/javascript "access plus 1 year"
- ExpiresByType text/ecmascript "access plus 1 year"
- ExpiresByType text/javascript "access plus 1 year"
- ExpiresByType text/css "access plus 1 year"
- </IfModule>
- # ----------------------------------------------------------------------
- # ETag removal
- # ----------------------------------------------------------------------
- # FileETag None is not enough for every server.
- <IfModule mod_headers.c>
- Header unset ETag
- </IfModule>
- # Since we're sending far-future expires, we don't need ETags for
- # static content.
- # developer.yahoo.com/performance/rules.html#etags
- FileETag None
- # ----------------------------------------------------------------------
- # UTF-8 encoding
- # ----------------------------------------------------------------------
- # Use UTF-8 encoding for anything served text/plain or text/html
- AddDefaultCharset utf-8
- # Force UTF-8 for a number of file formats
- AddCharset utf-8 .atom .css .js .json .rss .vtt .xml
- # Block access to "hidden" directories or files whose names begin with a
- # period. This includes directories used by version control systems such as
- # Subversion or Git.
- <IfModule mod_rewrite.c>
- RewriteCond %{SCRIPT_FILENAME} -d [OR]
- RewriteCond %{SCRIPT_FILENAME} -f
- RewriteRule "(^|/)\." - [F]
- </IfModule>
- # Block access to backup and source files. These files may be left by some
- # text/html editors and pose a great security danger, when anyone can access
- # them.
- <FilesMatch "(\.(bak|config|dist|fla|inc|ini|log|psd|sh|sql|swp)|~)$">
- Order allow,deny
- Deny from all
- Satisfy All
- </FilesMatch>
- # BEGIN WordPress
- RewriteEngine On
- RewriteBase /
- RewriteRule ^index\.php$ - [L]
- # add a trailing slash to /wp-admin
- RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
- RewriteCond %{REQUEST_FILENAME} -f [OR]
- RewriteCond %{REQUEST_FILENAME} -d
- RewriteRule ^ - [L]
- RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
- RewriteRule ^(.*\.php)$ wp/$1 [L]
- RewriteRule . index.php [L]
- # END WordPress
Advertisement
Add Comment
Please, Sign In to add comment