.htaccess 5.02 KB
Newer Older
root's avatar
root committed
1 2
RewriteEngine On
RewriteBase /
3 4 5 6 7 8 9 10 11
#Uncommenbt to lock WP

#RewriteCond %{REQUEST_URI} ^(.*)?register.*$ [OR]
#RewriteCond %{REQUEST_URI} ^(.*)?wp-comment-post\.php(.*)$ [OR]
#RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
#RewriteCond %{REQUEST_URI} ^(.*)?wp-post\.php(.*)$ [OR]
#RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
#RewriteRule ^(.*)$ http://cavallette.noblogs.org/2013/11/8487 [R,L]

root's avatar
root committed
12 13
RewriteRule ^index\.php$ - [L]

void's avatar
void committed
14 15 16 17 18
#### moved blogs.
RewriteCond %{HTTP_HOST}   ^ventitre\.noblogs\.org [NC]
RewriteRule ^/?(.*)         http://www.ventitre.org/$1 [L,R=301,NE]
####

Joe Oblivian's avatar
Joe Oblivian committed
19 20 21
#avoid inspection of queries log
RewriteRule ^/noblogs_queries.*	/ancheno [L,R=404]

root's avatar
root committed
22 23
# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
Joe's avatar
Joe committed
24 25 26 27
RewriteCond %{HTTP_X_FORWARDED_PROTO} https [NC]
RewriteRule ^gallery/([0-9]+)/(previews|previews-med)/(.*)$ https://noblogs.org/oldgal/$1/$2/$3 [R=301,L]
RewriteRule ^gallery/([0-9]+)/(previews|previews-med)/(.*)$ http://noblogs.org/oldgal/$1/$2/$3 [R=301,L]
#RewriteRule ^gallery/([0-9]+)/(previews|previews-med)/(.*)$ oldgal/$1/$2/$3 [L]
root's avatar
root committed
28 29 30 31 32 33 34
RewriteRule ^gallery/[0-9]+/(.*)$  wp-includes/ms-files.php?file=2010/08/$1 [L]
RewriteRule ^resource/[^/]+/preview/(.*)$ wp-includes/ms-files.php?file=2010/08/$1 [L]
RewriteRule ^resource/[^/]+/download/(.*)$ wp-includes/ms-files.php?file=2010/08/$1 [L]

# BEGIN WPSuperCache
<IfModule mod_rewrite.c>
AddDefaultCharset UTF-8
Joe Oblivian's avatar
Joe Oblivian committed
35 36
# Commented in order to cache more
# RewriteCond %{REQUEST_URI} !^.*[^/]$
root's avatar
root committed
37 38 39 40 41 42 43 44 45
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).*
RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).*
RewriteCond %{HTTP:Accept-Encoding} gzip
46 47 48
#RewriteCond %{HTTP:X-Forwarded-Proto} !^https$
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/%{HTTP:X-Forwarded-Proto}/$1/index.html.gz -f
RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/%{HTTP:X-Forwarded-Proto}/$1/index.html.gz" [L]
root's avatar
root committed
49

Joe Oblivian's avatar
Joe Oblivian committed
50 51
#Commented in order to cache more
#RewriteCond %{REQUEST_URI} !^.*[^/]$
root's avatar
root committed
52 53 54 55 56 57 58 59
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).*
RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).*
60 61 62
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/%{HTTP:X-Forwarded-Proto}/$1/index.html -f
#RewriteCond %{HTTP:X-Forwarded-Proto} !^https$
RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/%{HTTP:X-Forwarded-Proto}/$1/index.html" [L]
root's avatar
root committed
63 64 65 66 67 68 69 70 71 72
</IfModule>

# END WPSuperCache

# BEGIN WordPress
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
# END WordPress
root's avatar
root committed
73 74 75 76 77 78

# BEGIN noblogs

# .git doesn't exist
RedirectMatch 404 /\\.git(/|$)

79 80 81 82 83 84
# allow gathering stats only from localhost
<Files apc_stats_r2mon.php>
Order Allow,Deny
Allow from 127.0.0.1
</Files>

root's avatar
root committed
85
# END noblogs