Advertisement
Guest User

Untitled

a guest
Sep 16th, 2017
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.55 KB | None | 0 0
  1. # BEGIN Force HTTPSRewriteEngine On
  2. RewriteCond %{HTTPS} !=on
  3. RewriteCond %{ENV:HTTPS} !=on
  4. RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
  5.  
  6.  
  7. RewriteCond %{HTTP_HOST} !=domain.eu
  8. RewriteRule (.*) https://domain.eu/$1 [R=301,L]
  9. # END Force HTTPS
  10.  
  11.  
  12. # BEGIN HTTP Security Header
  13. <ifModule mod_headers.c>
  14. Header set X-XSS-Protection "1; mode=block"
  15. Header always append X-Frame-Options "SAMEORIGIN"
  16. Header set X-Content-Type-Options: "nosniff"
  17. Header set X-Frame-Options "SAMEORIGIN"
  18. Header set Strict-Transport-Security "max-age=15768000"
  19. Header set Cache-Control "no-store, no-cache, must-revalidate"
  20. Header set Content-Security-Policy "default-src https:"
  21. Header set Connection "keep-alive"
  22. </ifModule>
  23. # END HTTP Security Header
  24.  
  25.  
  26.  
  27. # BEGIN Zugriffsschutz (verändert)
  28. <Files wp-login.php>
  29. AuthName "Restricted Admin-Area"
  30. AuthType Basic
  31. AuthUserFile /lib/w/virtual/user/site/.passwd
  32. Require valid-user
  33. </Files>
  34. # END Zugriffsschutz
  35.  
  36.  
  37. # WordPress SEO - XML Sitemap Rewrite Fix
  38. RewriteEngine On
  39. RewriteBase /
  40. RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
  41. RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
  42. RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
  43. RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
  44. RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
  45. # END WordPress SEO - XML Sitemap Rewrite Fix
  46.  
  47.  
  48. # BEGIN SF Move Login (verändert)
  49. <IfModule mod_rewrite.c>
  50. RewriteEngine On
  51. RewriteBase /
  52. RewriteRule ^login/?$ wp-login.php [QSA,L]
  53. RewriteRule ^post/?$ wp-login.php?action=postpass [QSA,L]
  54. RewriteRule ^logout/?$ wp-login.php?action=logout [QSA,L]
  55. RewriteRule ^lostpassword?$ wp-login.php?action=lostpassword [QSA,L]
  56. RewriteRule ^resetpass/?$ wp-login.php?action=resetpass [QSA,L]
  57. RewriteRule ^rregister /?$ wp-login.php?action=register [QSA,L]
  58. </IfModule>
  59. # END SF Move Login
  60.  
  61.  
  62.  
  63.  
  64. # BEGIN WordPress
  65. <IfModule mod_rewrite.c>
  66. RewriteEngine On
  67. RewriteBase /
  68. RewriteRule ^index\.php$ - [L]
  69. RewriteCond %{REQUEST_FILENAME} !-f
  70. RewriteCond %{REQUEST_FILENAME} !-d
  71. RewriteRule . /index.php [L]
  72. </IfModule>
  73. # END WordPress
  74.  
  75.  
  76. # BEGIN Zugriff auf Include-Dateien verhindern
  77. <IfModule mod_rewrite.c>
  78. RewriteEngine On
  79. RewriteBase /
  80. RewriteRule ^wp-admin/includes/ - [F,L]
  81. RewriteRule !^wp-includes/ - [S=3]
  82. RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
  83. RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
  84. RewriteRule ^wp-includes/theme-compat/ - [F,L]
  85. </IfModule>
  86. # END Zugriff auf Include-Dateien verhindern
  87.  
  88.  
  89. # BEGIN Zugriff auf wp-config, Logdateien, .hta bzw. .htp und Liesmich verhindern
  90. <FilesMatch "(\.htaccess|\.htpasswd|wp-config\.php|liesmich\.html|readme\.html)">
  91. order deny,allow
  92. deny from all
  93. satisfy all
  94. </FilesMatch>
  95. # END Zugriff auf wp-config, Logdateien, .hta bzw. .htp und Liesmich verhindern
  96.  
  97.  
  98. # BEGIN Protect files and directories from prying eyes.
  99. <FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
  100. Order allow,deny
  101. </FilesMatch>
  102. # END Protect files and directories from prying eyes.
  103.  
  104.  
  105. # BEGIN Prevent folder browsing
  106. Options -Indexes
  107. # END Prevent folder browsing
  108.  
  109.  
  110. # BEGIN XML RPC deaktivieren
  111. <Files xmlrpc.php>
  112. Order Deny,Allow
  113. Deny from all
  114. </Files>
  115. # END XML RPC deaktivieren
  116.  
  117.  
  118. # DISABLE ETAGS
  119. <filesMatch "\\.(ico|pdf|flv|jpe?g?|png|gif|js|css|swf|txt|mp3|avi|mpe?g?|wmv)$">
  120. FileETag none
  121. </filesMatch>
  122.  
  123.  
  124. # BEGIN BLOCK EVIL REQUESTS
  125. <ifModule mod_rewrite.c>
  126. Options +SymLinksIfOwnerMatch
  127. RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
  128. RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
  129. RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
  130. RewriteRule .* blacklist.php [F,L]
  131. </ifModule>
  132. # END BLOCK EVIL REQUESTS
  133.  
  134.  
  135. # BEGIN PHP Errors nicht anzeigen
  136. # php_flag display_errors Off
  137. # END PHP Errors nicht anzeigen
  138.  
  139.  
  140. # BEGIN gzip Compression if availiable
  141. <IfModule mod_gzip.c>
  142. mod_gzip_on Yes
  143. mod_gzip_dechunk Yes
  144. mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
  145. mod_gzip_item_include handler ^cgi-script$
  146. mod_gzip_item_include mime ^text/.*
  147. mod_gzip_item_include mime ^application/x-javascript.*
  148. mod_gzip_item_exclude mime ^image/.*
  149. mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
  150. </IfModule>
  151. # END gzip Compression if availiable
  152.  
  153.  
  154. # BEGIN Deflate Compress text files
  155. <ifModule mod_deflate.c>
  156. AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript application/x-shockwave-flash
  157. </ifModule>
  158. # END Compress text files
  159.  
  160.  
  161. # BEGIN Expire headers
  162. <ifModule mod_expires.c>
  163. ExpiresActive On
  164. ExpiresDefault "access plus 60 seconds"
  165. ExpiresByType image/x-icon "access plus 1 month"
  166. ExpiresByType image/jpeg "access plus 1 month"
  167. ExpiresByType image/png "access plus 1 month"
  168. ExpiresByType image/gif "access plus 1 month"
  169. ExpiresByType application/x-shockwave-flash "access plus 1 month"
  170. ExpiresByType text/css "access plus 2 weeks"
  171. ExpiresByType text/javascript "access plus 1 week"
  172. ExpiresByType application/javascript "access plus 1 week"
  173. ExpiresByType application/x-javascript "access plus 1 week"
  174. ExpiresByType text/html "access plus 900 seconds"
  175. ExpiresByType application/xhtml+xml "access plus 900 seconds"
  176. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  177. ExpiresByType application/x-font-ttf "access plus 1 month"
  178. ExpiresByType application/x-font-woff "access plus 1 month"
  179. ExpiresByType font/opentype "access plus 1 month"
  180. ExpiresByType image/svg+xml "access plus 1 day"
  181. </ifModule>
  182. # END Expire headers
  183.  
  184.  
  185. # Keep alive
  186. <ifModule mod_headers.c>
  187. Header set Connection keep-alive
  188. </ifModule>
  189.  
  190.  
  191. # BEGIN Cache-Control Headers
  192. <ifModule mod_headers.c>
  193. <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
  194. Header set Cache-Control "public"
  195. </filesMatch>
  196. <filesMatch "\.(css)$">
  197. Header set Cache-Control "public"
  198. </filesMatch>
  199. <filesMatch "\.(js)$">
  200. Header set Cache-Control "private"
  201. </filesMatch>
  202. <filesMatch "\.(x?html?|php)$">
  203. Header set Cache-Control "private, must-revalidate"
  204. </filesMatch>
  205. </ifModule>
  206. # END Cache-Control Headers
  207.  
  208.  
  209. # BEGIN Deaktivate ETags
  210. Header unset ETag
  211. FileETag None
  212. # END Deaktivate ETags
  213.  
  214.  
  215. # BEGIN No Hotlinking
  216. RewriteCond %{HTTP_REFERER} !^$
  217. RewriteCond %{HTTP_REFERER} !^https://domain.eu/.*$ [NC]
  218. RewriteCond %{HTTP_REFERER} !^https://domain.eu$ [NC]
  219. RewriteCond %{HTTP_REFERER} !^https://domain.eu/.*$ [NC]
  220. RewriteCond %{HTTP_REFERER} !^https://www.domain.eu$ [NC]
  221. RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://sorry.nohotlinking [R,NC]
  222. # END No Hotlinking
  223.  
  224.  
  225. # BEGIN Better experience for IE users
  226. <IfModule mod_headers.c>
  227. Header set X-UA-Compatible "IE=Edge,chrome=1"
  228. # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
  229. <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|xpi|safariextz|vcf)$" >
  230. Header unset X-UA-Compatible
  231. </FilesMatch>
  232. </IfModule>
  233. # END Better experience for IE users
  234.  
  235.  
  236. # BEGIN Proper MIME type for all files
  237. AddType application/javascript js
  238. AddType audio/ogg oga ogg
  239. AddType audio/mp4 m4a
  240. AddType video/ogg ogv
  241. AddType video/mp4 mp4 m4v
  242. AddType video/webm webm
  243. AddType image/svg+xml svg svgz
  244. AddEncoding gzip svgz
  245. AddType application/vnd.ms-fontobject eot
  246. AddType application/x-font-ttf ttf ttc
  247. AddType font/opentype otf
  248. AddType application/x-font-woff woff
  249. AddType image/x-icon ico
  250. AddType image/webp webp
  251. AddType text/cache-manifest appcache manifest
  252. AddType text/x-component htc
  253. AddType application/x-chrome-extension crx
  254. AddType application/x-xpinstall xpi
  255. AddType application/octet-stream safariextz
  256. AddType text/x-vcard vcf
  257. # END Proper MIME type for all files
  258.  
  259.  
  260. # BEGIN Use UTF-8 encoding for anything served text/plain or text/html
  261. AddDefaultCharset utf-8
  262. AddCharset utf-8 .html .css .js .xml .json .rss .atom
  263. # END Use UTF-8 encoding for anything served text/plain or text/html
  264.  
  265.  
  266. <IfModule mod_rewrite.c>
  267. # BEGIN Block access to "hidden" directories
  268. RewriteRule "(^|/)\." - [F]
  269. # END Block access to "hidden" directories
  270.  
  271.  
  272. # BEGIN Rules to prevent php execution in uploads
  273. RewriteRule ^(.*)/uploads/(.*).php(.?) - [F]
  274. # END Rules to prevent php execution in uploads
  275.  
  276. # BEGIN Rules to block unneeded HTTP methods
  277. RewriteCond %{REQUEST_METHOD} ^(TRACE|DELETE|TRACK) [NC]
  278. RewriteRule ^(.*)$ - [F]
  279. # END Rules to block unneeded HTTP methods
  280.  
  281.  
  282. # BEGIN Rules to block suspicious URIs
  283. RewriteCond %{QUERY_STRING} \.\.\/ [NC,OR]
  284. RewriteCond %{QUERY_STRING} ^.*\.(bash|git|hg|log|svn|swp|cvs) [NC,OR]
  285. RewriteCond %{QUERY_STRING} etc/passwd [NC,OR]
  286. RewriteCond %{QUERY_STRING} boot\.ini [NC,OR]
  287. RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
  288. RewriteCond %{QUERY_STRING} http\: [NC,OR]
  289. RewriteCond %{QUERY_STRING} https\: [NC,OR]
  290. RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
  291. RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [NC,OR]
  292. RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
  293. RewriteCond %{QUERY_STRING} ^.*(%24&x).* [NC,OR]
  294. RewriteCond %{QUERY_STRING} ^.*(127\.0).* [NC,OR]
  295. RewriteCond %{QUERY_STRING} ^.*(globals|encode|localhost|loopback).* [NC,OR]
  296. RewriteCond %{QUERY_STRING} ^.*(request|concat|insert|union|declare).* [NC]
  297. RewriteCond %{QUERY_STRING} !^loggedout=true
  298. RewriteCond %{QUERY_STRING} !^action=jetpack-sso
  299. RewriteCond %{QUERY_STRING} !^action=rp
  300. RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$
  301. RewriteCond %{HTTP_REFERER} !^http://maps\.googleapis\.com(.*)$
  302. RewriteRule ^(.*)$ - [F]
  303. # BEGIN Rules to block suspicious URIs
  304. </IfModule>
  305.  
  306.  
  307.  
  308.  
  309. # BEGIN Block Semalt related referrer spam
  310. RewriteEngine on
  311. RewriteCond %{HTTP_REFERER} ^http://.*youtubedownload\.org/ [NC,OR]
  312. RewriteCond %{HTTP_REFERER} ^http://.*softomix\.ru/ [NC,OR]
  313. RewriteCond %{HTTP_REFERER} ^http://.*zazagames\.org/ [NC,OR]
  314. RewriteCond %{HTTP_REFERER} ^http://.*youtubedownload\.org/ [NC,OR]
  315. RewriteCond %{HTTP_REFERER} ^http://.*vapmedia\.org/ [NC,OR]
  316. RewriteCond %{HTTP_REFERER} ^http://.*soundfrost\.org/ [NC,OR]
  317. RewriteCond %{HTTP_REFERER} ^http://.*joingames\.org/ [NC,OR]
  318. RewriteCond %{HTTP_REFERER} ^http://.*videofrost\.net/ [NC,OR]
  319. RewriteCond %{HTTP_REFERER} ^http://.*softomix\.net/ [NC,OR]
  320. RewriteCond %{HTTP_REFERER} ^http://.*feedouble\.net/ [NC,OR]
  321. RewriteCond %{HTTP_REFERER} ^http://.*backgroundpictures\.net/ [NC,OR]
  322. RewriteCond %{HTTP_REFERER} ^http://.*joinandplay\.me/ [NC,OR]
  323. RewriteCond %{HTTP_REFERER} ^http://.*videofrost\.com/ [NC,OR]
  324. RewriteCond %{HTTP_REFERER} ^http://.*srecorder\.com/ [NC,OR]
  325. RewriteCond %{HTTP_REFERER} ^http://.*softomix\.com/ [NC,OR]
  326. RewriteCond %{HTTP_REFERER} ^http://.*openmediasoft\.com/ [NC,OR]
  327. RewriteCond %{HTTP_REFERER} ^http://.*openfrost\.com/ [NC,OR]
  328. RewriteCond %{HTTP_REFERER} ^http://.*myprintscreen\.com/ [NC,OR]
  329. RewriteCond %{HTTP_REFERER} ^http://.*musicprojectfoundation\.com/ [NC,OR]
  330. RewriteCond %{HTTP_REFERER} ^http://.*feedouble\.com/ [NC,OR]
  331. RewriteCond %{HTTP_REFERER} ^http://.*fbfreegifts\.com/ [NC,OR]
  332. RewriteCond %{HTTP_REFERER} ^http://.*extener\.com/ [NC,OR]
  333. RewriteCond %{HTTP_REFERER} ^http://.*embedle\.com/ [NC,OR]
  334. RewriteCond %{HTTP_REFERER} ^http://.*savetubevideo\.com/ [NC,OR]
  335. RewriteCond %{HTTP_REFERER} ^http://.*kambasoft\.com/ [NC,OR]
  336. RewriteCond %{HTTP_REFERER} buttons\-for\-website\.com [NC,OR]
  337. RewriteCond %{HTTP_REFERER} ^http://.*semalt\.com/ [NC]
  338. RewriteCond %{HTTP_REFERER} 7makemoneyonline\.com [NC,OR]
  339. RewriteRule ^(.*)$ – [F,L]
  340. # END Block Semalt related referrer spam
  341.  
  342.  
  343. # BEGIN Badbots blockieren [Letzte Aktualisierung: 12.02.2015]
  344. RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
  345. RewriteCond %{HTTP_USER_AGENT} updown_tester [OR]
  346. RewriteCond %{HTTP_USER_AGENT} (spbot|OpenLinkProfiler) [OR]
  347. RewriteCond %{HTTP_USER_AGENT} (Squider|Squider/0.01)$ [OR]
  348. RewriteCond %{HTTP_USER_AGENT} (memorybot|memoryBot) [OR]
  349. RewriteCond %{HTTP_USER_AGENT} ^magpie-crawler/[0-9] [OR]
  350. RewriteCond %{HTTP_USER_AGENT} SiteExplorer/[0-9] [OR]
  351. RewriteCond %{HTTP_USER_AGENT} Spiderlytics/[0-9] [OR]
  352. RewriteCond %{HTTP_USER_AGENT} ProCogSEOBot/[0-9] [OR]
  353. RewriteCond %{HTTP_USER_AGENT} ^libwww-perl/[0-9] [OR]
  354. RewriteCond %{HTTP_USER_AGENT} TurnitinBot/[0-9] [OR]
  355. RewriteCond %{HTTP_USER_AGENT} meanpathbot/[0-9] [OR]
  356. RewriteCond %{HTTP_USER_AGENT} SemrushBot/[0-9] [OR]
  357. RewriteCond %{HTTP_USER_AGENT} Infohelfer/[0-9] [OR]
  358. RewriteCond %{HTTP_USER_AGENT} CompSpyBot/[0-9] [OR]
  359. RewriteCond %{HTTP_USER_AGENT} AhrefsBot/[0-9] [OR]
  360. RewriteCond %{HTTP_USER_AGENT} CareerBot/[0-9] [OR]
  361. RewriteCond %{HTTP_USER_AGENT} Moreover/[0-9] [OR]
  362. RewriteCond %{HTTP_USER_AGENT} BLEXBot/[0-9] [OR]
  363. RewriteCond %{HTTP_USER_AGENT} Ezooms/[0-9] [OR]
  364. RewriteCond %{HTTP_USER_AGENT} Abonti/[0-9] [OR]
  365. RewriteCond %{HTTP_USER_AGENT} DCPbot/[0-9] [OR]
  366. RewriteCond %{HTTP_USER_AGENT} ^Java/[0-9] [OR]
  367. RewriteCond %{HTTP_USER_AGENT} oBot/[0-9] [OR]
  368. RewriteCond %{HTTP_USER_AGENT} ^BOT/[0-9] [OR]
  369. RewriteCond %{HTTP_USER_AGENT} SearchmetricsBot [OR]
  370. RewriteCond %{HTTP_USER_AGENT} OpenindexSpider [OR]
  371. RewriteCond %{HTTP_USER_AGENT} BacklinkCrawler [OR]
  372. RewriteCond %{HTTP_USER_AGENT} ^ssearch_bot [OR]
  373. RewriteCond %{HTTP_USER_AGENT} UnisterBot [OR]
  374. RewriteCond %{HTTP_USER_AGENT} 360Spider$ [OR]
  375. RewriteCond %{HTTP_USER_AGENT} HubSpot\sWebcrawler$ [OR]
  376. RewriteCond %{HTTP_USER_AGENT} SISTRIX
  377. RewriteRule ^ - [F,L]
  378. # END Badbots blockieren
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement