Advertisement
Beee

fr htaccess

Aug 13th, 2018
735
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 36.88 KB | None | 0 0
  1. # ##############################################################################
  2. # # URL REDIRECTS                                                              #
  3. # ##############################################################################
  4.  
  5. # Write your 301/302 redirects here, mostly used for proper routing / SEO
  6.  
  7. # ##############################################################################
  8. # # URL REWRITES                                                               #
  9. # ##############################################################################
  10.  
  11. # ------------------------------------------------------------------------------
  12. # | Rewrite engine                                                             |
  13. # ------------------------------------------------------------------------------
  14.  
  15. # Turning on the rewrite engine and enabling the `FollowSymLinks` option is
  16. # necessary for the following directives to work.
  17.  
  18. # If your web host doesn't allow the `FollowSymlinks` option, you may need to
  19. # comment it out and use `Options +SymLinksIfOwnerMatch` but, be aware of the
  20. # performance impact: http://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks
  21.  
  22. # Also, some cloud hosting services require `RewriteBase` to be set:
  23. # http://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-mod-rewrite-not-working-on-my-site
  24.  
  25. <IfModule mod_rewrite.c>
  26.     Options +FollowSymlinks
  27.  #  Options +SymLinksIfOwnerMatch
  28.    RewriteEngine On
  29.     RewriteBase /
  30.  
  31.     # If the requested filename exists, simply serve it.
  32.    # We only want to let Apache serve files and not directories.
  33.    RewriteCond %{REQUEST_FILENAME} -f
  34.  #  RewriteCond %{REQUEST_FILENAME} !-d
  35.    RewriteRule .* - [L]
  36.  
  37.     # Admin 404 Fix
  38.    RewriteRule ^wp/wp-admin/$ wp/wp-admin/index.php [L]
  39.  
  40.     # Rewrite all other queries to the Wordpress.
  41.    RewriteRule .* wp/index.php [L]         # Use if live env is up
  42. #  RewriteRule .* content/maintenance.php [L]      # Use if updating live env
  43. </IfModule>
  44.  
  45.  
  46. # ------------------------------------------------------------------------------
  47. # | Suppressing / Forcing the "www." at the beginning of URLs                  |
  48. # ------------------------------------------------------------------------------
  49.  
  50. # The same content should never be available under two different URLs especially
  51. # not with and without "www." at the beginning. This can cause SEO problems
  52. # (duplicate content), therefore, you should choose one of the alternatives and
  53. # redirect the other one.
  54.  
  55. # By default option 1 (no "www.") is activated:
  56. # http://no-www.org/faq.php?q=class_b
  57.  
  58. # If you'd prefer to use option 2, just comment out all the lines from option 1
  59. # and uncomment the ones from option 2.
  60.  
  61. # IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME!
  62.  
  63. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  64.  
  65. # Option 1: rewrite www.example.com → example.com
  66.  
  67. #<IfModule mod_rewrite.c>
  68. #    RewriteCond %{HTTPS} !=on
  69. #    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  70. #    RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
  71. #</IfModule>
  72.  
  73. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  74.  
  75. # Option 2: rewrite example.com → www.example.com
  76.  
  77. # Be aware that the following might not be a good idea if you use "real"
  78. # subdomains for certain parts of your website.
  79.  
  80. <IfModule mod_rewrite.c>
  81.    RewriteCond %{HTTPS} !=on
  82.    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
  83.    RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  84. </IfModule>
  85.  
  86. # (!) Using `.htaccess` files slows down Apache, therefore, if you have access
  87. # to the main server config file (usually called `httpd.conf`), you should add
  88. # this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html.
  89.  
  90. # ##############################################################################
  91. # # CROSS-ORIGIN RESOURCE SHARING (CORS)                                       #
  92. # ##############################################################################
  93.  
  94. # ------------------------------------------------------------------------------
  95. # | Cross-domain AJAX requests                                                 |
  96. # ------------------------------------------------------------------------------
  97.  
  98. # Enable cross-origin AJAX requests.
  99. # http://code.google.com/p/html5security/wiki/CrossOriginRequestSecurity
  100. # http://enable-cors.org/
  101.  
  102. # <IfModule mod_headers.c>
  103. #    Header set Access-Control-Allow-Origin "*"
  104. # </IfModule>
  105.  
  106. # ------------------------------------------------------------------------------
  107. # | CORS-enabled images                                                        |
  108. # ------------------------------------------------------------------------------
  109.  
  110. # Send the CORS header for images when browsers request it.
  111. # https://developer.mozilla.org/en/CORS_Enabled_Image
  112. # http://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
  113. # http://hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/
  114.  
  115. <IfModule mod_setenvif.c>
  116.     <IfModule mod_headers.c>
  117.         <FilesMatch "\.(gif|ico|jpe?g|png|svg|svgz|webp)$">
  118.             SetEnvIf Origin ":" IS_CORS
  119.             Header set Access-Control-Allow-Origin "*" env=IS_CORS
  120.         </FilesMatch>
  121.     </IfModule>
  122. </IfModule>
  123.  
  124.  
  125. # ------------------------------------------------------------------------------
  126. # | Web fonts access                                                           |
  127. # ------------------------------------------------------------------------------
  128.  
  129. # Allow access from all domains for web fonts
  130.  
  131. <IfModule mod_headers.c>
  132.     <FilesMatch "\.(eot|font.css|otf|ttc|ttf|woff)$">
  133.         Header set Access-Control-Allow-Origin "*"
  134.     </FilesMatch>
  135. </IfModule>
  136.  
  137.  
  138. # ##############################################################################
  139. # # ERRORS                                                                     #
  140. # ##############################################################################
  141.  
  142. # ------------------------------------------------------------------------------
  143. # | 404 error prevention for non-existing redirected folders                   |
  144. # ------------------------------------------------------------------------------
  145.  
  146. # Prevent Apache from returning a 404 error for a rewrite if a directory
  147. # with the same name does not exist.
  148. # http://httpd.apache.org/docs/current/content-negotiation.html#multiviews
  149. # http://www.webmasterworld.com/apache/3808792.htm
  150.  
  151. # TAKE CARE, THIS DOESN'T FLY ON VELLANCE'S SHARED HOSTING
  152. # Options -MultiViews
  153.  
  154. # ------------------------------------------------------------------------------
  155. # | Custom error messages / pages                                              |
  156. # ------------------------------------------------------------------------------
  157.  
  158. # You can customize what Apache returns to the client in case of an error (see
  159. # http://httpd.apache.org/docs/current/mod/core.html#errordocument), e.g.:
  160.  
  161. ErrorDocument 404 /content/themes/v5/404.php
  162. # ErrorDocument 403 /content/themes/v4/403.php
  163. # ErrorDocument 500 /content/themes/v4/500.php
  164.  
  165.  
  166. # ##############################################################################
  167. # # INTERNET EXPLORER                                                          #
  168. # ##############################################################################
  169.  
  170. # ------------------------------------------------------------------------------
  171. # | Better website experience                                                  |
  172. # ------------------------------------------------------------------------------
  173.  
  174. # Force IE to render pages in the highest available mode in the various
  175. # cases when it may not: http://hsivonen.iki.fi/doctype/ie-mode.pdf.
  176.  
  177. <IfModule mod_headers.c>
  178.     Header set X-UA-Compatible "IE=edge"
  179.     # `mod_headers` can't match based on the content-type, however, we only
  180.    # want to send this header for HTML pages and not for the other resources
  181.    <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|webapp|webm|webp|woff|xml|xpi)$">
  182.         Header unset X-UA-Compatible
  183.     </FilesMatch>
  184. </IfModule>
  185.  
  186. # ------------------------------------------------------------------------------
  187. # | Cookie setting from iframes                                                |
  188. # ------------------------------------------------------------------------------
  189.  
  190. # Allow cookies to be set from iframes in IE.
  191.  
  192. # <IfModule mod_headers.c>
  193. #   Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
  194. # </IfModule>
  195.  
  196. # ------------------------------------------------------------------------------
  197. # | Screen flicker                                                             |
  198. # ------------------------------------------------------------------------------
  199.  
  200. # Stop screen flicker in IE on CSS rollovers (this only works in
  201. # combination with the `ExpiresByType` directives for images from below).
  202.  
  203. # BrowserMatch "MSIE" brokenvary=1
  204. # BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
  205. # BrowserMatch "Opera" !brokenvary
  206. # SetEnvIf brokenvary 1 force-no-vary
  207.  
  208.  
  209. # ##############################################################################
  210. # # MIME TYPES AND ENCODING                                                    #
  211. # ##############################################################################
  212.  
  213. # ------------------------------------------------------------------------------
  214. # | Proper MIME types for all files                                            |
  215. # ------------------------------------------------------------------------------
  216.  
  217. <IfModule mod_mime.c>
  218.  
  219.   # Audio
  220.    AddType audio/mp4                                   m4a f4a f4b
  221.     AddType audio/ogg                                   oga ogg
  222.  
  223.   # JavaScript
  224.    # Normalize to standard type (it's sniffed in IE anyways):
  225.    # http://tools.ietf.org/html/rfc4329#section-7.2
  226.    AddType application/javascript                      js jsonp
  227.     AddType application/json                            json
  228.  
  229.   # Video
  230.    AddType video/mp4                                   mp4 m4v f4v f4p
  231.     AddType video/ogg                                   ogv
  232.     AddType video/webm                                  webm
  233.     AddType video/x-flv                                 flv
  234.  
  235.   # Web fonts
  236.    AddType application/font-woff                       woff
  237.     AddType application/vnd.ms-fontobject               eot
  238.  
  239.     # Browsers usually ignore the font MIME types and sniff the content,
  240.    # however, Chrome shows a warning if other MIME types are used for the
  241.    # following fonts.
  242.    AddType application/x-font-ttf                      ttc ttf
  243.     AddType font/opentype                               otf
  244.  
  245.     # Make SVGZ fonts work on iPad:
  246.    # https://twitter.com/FontSquirrel/status/14855840545
  247.    AddType     image/svg+xml                           svg svgz
  248.     AddEncoding gzip                                    svgz
  249.  
  250.   # Other
  251.    AddType application/octet-stream                    safariextz
  252.     AddType application/x-chrome-extension              crx
  253.     AddType application/x-opera-extension               oex
  254.     AddType application/x-shockwave-flash               swf
  255.     AddType application/x-web-app-manifest+json         webapp
  256.     AddType application/x-xpinstall                     xpi
  257.     AddType application/xml                             atom rdf rss xml
  258.     AddType image/webp                                  webp
  259.     AddType image/x-icon                                ico
  260.     AddType text/cache-manifest                         appcache manifest
  261.     AddType text/vtt                                    vtt
  262.     AddType text/x-component                            htc
  263.     AddType text/x-vcard                                vcf
  264.  
  265. </IfModule>
  266.  
  267. # ------------------------------------------------------------------------------
  268. # | UTF-8 encoding                                                             |
  269. # ------------------------------------------------------------------------------
  270.  
  271. # Use UTF-8 encoding for anything served as `text/html` or `text/plain`.
  272. AddDefaultCharset utf-8
  273.  
  274. # Force UTF-8 for certain file formats.
  275. <IfModule mod_mime.c>
  276.     AddCharset utf-8 .atom .css .js .json .rss .vtt .webapp .xml
  277. </IfModule>
  278.  
  279.  
  280. # ##############################################################################
  281. # # SECURITY                                                                   #
  282. # ##############################################################################
  283.  
  284. # ------------------------------------------------------------------------------
  285. # | Content Security Policy (CSP)                                              |
  286. # ------------------------------------------------------------------------------
  287.  
  288. # You can mitigate the risk of cross-site scripting and other content-injection
  289. # attacks by setting a Content Security Policy which whitelists trusted sources
  290. # of content for your site.
  291.  
  292. # The example header below allows ONLY scripts that are loaded from the current
  293. # site's origin (no inline scripts, no CDN, etc). This almost certainly won't
  294. # work as-is for your site!
  295.  
  296. # To get all the details you'll need to craft a reasonable policy for your site,
  297. # read: http://html5rocks.com/en/tutorials/security/content-security-policy (or
  298. # see the specification: http://w3.org/TR/CSP).
  299.  
  300. # <IfModule mod_headers.c>
  301. #    Header set Content-Security-Policy "script-src 'self'; object-src 'self'"
  302. #    <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|webapp|webm|webp|woff|xml|xpi)$">
  303. #        Header unset Content-Security-Policy
  304. #    </FilesMatch>
  305. # </IfModule>
  306.  
  307. # ------------------------------------------------------------------------------
  308. # | File access                                                                |
  309. # ------------------------------------------------------------------------------
  310.  
  311. # Block access to directories without a default document.
  312. # Usually you should leave this uncommented because you shouldn't allow anyone
  313. # to surf through every directory on your server (which may includes rather
  314. # private places like the CMS's directories).
  315.  
  316. <IfModule mod_autoindex.c>
  317.     Options -Indexes
  318. </IfModule>
  319.  
  320. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  321.  
  322. # Block access to hidden files and directories.
  323. # This includes directories used by version control systems such as Git and SVN.
  324.  
  325. <IfModule mod_rewrite.c>
  326.     RewriteCond %{SCRIPT_FILENAME} -d [OR]
  327.     RewriteCond %{SCRIPT_FILENAME} -f
  328.     RewriteRule "(^|/)\." - [F]
  329. </IfModule>
  330.  
  331. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  332.  
  333. # Block access to backup and source files.
  334. # These files may be left by some text editors and can pose a great security
  335. # danger when anyone has access to them.
  336.  
  337. <FilesMatch "(^#.*#|\.(bak|config|dist|fla|inc|ini|log|psd|sh|sql|sw[op])|~)$">
  338.     Order allow,deny
  339.     Deny from all
  340.     Satisfy All
  341. </FilesMatch>
  342.  
  343. # ------------------------------------------------------------------------------
  344. # | Secure Sockets Layer (SSL)                                                 |
  345. # ------------------------------------------------------------------------------
  346.  
  347. # Rewrite secure requests properly to prevent SSL certificate warnings, e.g.:
  348. # prevent `https://www.example.com` when your certificate only allows
  349. # `https://secure.example.com`.
  350.  
  351. # <IfModule mod_rewrite.c>
  352. #    RewriteCond %{SERVER_PORT} !^443
  353. #    RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L]
  354. # </IfModule>
  355.  
  356. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  357.  
  358. # Force client-side SSL redirection.
  359.  
  360. # If a user types "example.com" in his browser, the above rule will redirect him
  361. # to the secure version of the site. That still leaves a window of opportunity
  362. # (the initial HTTP connection) for an attacker to downgrade or redirect the
  363. # request. The following header ensures that browser will ONLY connect to your
  364. # server via HTTPS, regardless of what the users type in the address bar.
  365. # http://www.html5rocks.com/en/tutorials/security/transport-layer-security/
  366.  
  367. # <IfModule mod_headers.c>
  368. #    Header set Strict-Transport-Security max-age=16070400;
  369. # </IfModule>
  370.  
  371. # ------------------------------------------------------------------------------
  372. # | Server software information                                                |
  373. # ------------------------------------------------------------------------------
  374.  
  375. # Avoid displaying the exact Apache version number, the description of the
  376. # generic OS-type and the information about Apache's compiled-in modules.
  377.  
  378. # ADD THIS DIRECTIVE IN THE `httpd.conf` AS IT WILL NOT WORK IN THE `.htaccess`!
  379.  
  380. # ServerTokens Prod
  381.  
  382. # ------------------------------------------------------------------------------
  383. # | Disallow iframe calls from other domains                                   |
  384. # ------------------------------------------------------------------------------
  385.  
  386. <IfModule mod_headers.c>
  387.     Header always append X-Frame-Options SAMEORIGIN
  388. </IfModule>
  389.  
  390.  
  391. # ##############################################################################
  392. # # WEB PERFORMANCE                                                            #
  393. # ##############################################################################
  394.  
  395. # ------------------------------------------------------------------------------
  396. # | Compression                                                                |
  397. # ------------------------------------------------------------------------------
  398.  
  399. <IfModule mod_deflate.c>
  400.  
  401.     <IfModule mod_headers.c>
  402.         Header append Vary User-Agent env=!dont-vary
  403.     </IfModule>
  404.  
  405.     # Force compression for mangled headers.
  406.    # http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping
  407.    <IfModule mod_setenvif.c>
  408.         <IfModule mod_headers.c>
  409.             SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
  410.             RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
  411.         </IfModule>
  412.     </IfModule>
  413.  
  414.     # Compress all output labeled with one of the following MIME-types
  415.    # (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
  416.    #  and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines
  417.    #  as `AddOutputFilterByType` is still in the core directives).
  418.    <IfModule mod_filter.c>
  419.         AddOutputFilterByType DEFLATE application/atom+xml \
  420.                                       application/javascript \
  421.                                       application/json \
  422.                                       application/rss+xml \
  423.                                       application/vnd.ms-fontobject \
  424.                                       application/x-font-ttf \
  425.                                       application/x-web-app-manifest+json \
  426.                                       application/xhtml+xml \
  427.                                       application/xml \
  428.                                       font/opentype \
  429.                                       image/svg+xml \
  430.                                       image/x-icon \
  431.                                       text/css \
  432.                                       text/html \
  433.                                       text/plain \
  434.                                       text/x-component \
  435.                                       text/xml
  436.     </IfModule>
  437.  
  438.     # DEFLATE by extension
  439.    <IfModule mod_mime.c>
  440.         AddOutputFilter DEFLATE js css htm html xml
  441.     </IfModule>
  442.  
  443. </IfModule>
  444.  
  445. # ------------------------------------------------------------------------------
  446. # | Content transformations                                                    |
  447. # ------------------------------------------------------------------------------
  448.  
  449. # Prevent some of the mobile network providers from modifying the content of
  450. # your site: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5.
  451.  
  452. # <IfModule mod_headers.c>
  453. #    Header set Cache-Control "no-transform"
  454. # </IfModule>
  455.  
  456. # ------------------------------------------------------------------------------
  457. # | ETag removal                                                               |
  458. # ------------------------------------------------------------------------------
  459.  
  460. # Since we're sending far-future expires headers (see below), ETags can
  461. # be removed: http://developer.yahoo.com/performance/rules.html#etags.
  462.  
  463. # `FileETag None` is not enough for every server.
  464. <IfModule mod_headers.c>
  465.     Header unset ETag
  466. </IfModule>
  467.  
  468. FileETag None
  469.  
  470. # ------------------------------------------------------------------------------
  471. # | Expires headers (for better cache control)                                 |
  472. # ------------------------------------------------------------------------------
  473.  
  474. # The following expires headers are set pretty far in the future. If you don't
  475. # control versioning with filename-based cache busting, consider lowering the
  476. # cache time for resources like CSS and JS to something like 1 week.
  477.  
  478. # TAKE CARE, THIS DOESN'T FLY ON VELLANCE'S SHARED HOSTING
  479. <IfModule mod_expires.c>
  480.  
  481. #    ExpiresActive on
  482. #    ExpiresDefault                                      "access plus 1 month"
  483. #
  484. #  # CSS
  485. #    ExpiresByType text/css                              "access plus 1 year"
  486. #
  487. #  # Data interchange
  488. #    ExpiresByType application/json                      "access plus 0 seconds"
  489. #    ExpiresByType application/xml                       "access plus 0 seconds"
  490. #    ExpiresByType text/xml                              "access plus 0 seconds"
  491. #
  492. #  # Favicon (cannot be renamed!)
  493. #    ExpiresByType image/x-icon                          "access plus 1 week"
  494. #
  495. #  # HTML components (HTCs)
  496. #    ExpiresByType text/x-component                      "access plus 1 month"
  497. #
  498. #  # HTML
  499. #    ExpiresByType text/html                             "access plus 0 seconds"
  500. #
  501. #  # JavaScript
  502. #    ExpiresByType application/javascript                "access plus 1 year"
  503. #
  504. #  # Manifest files
  505. #    ExpiresByType application/x-web-app-manifest+json   "access plus 0 seconds"
  506. #    ExpiresByType text/cache-manifest                   "access plus 0 seconds"
  507. #
  508. #  # Media
  509. #    ExpiresByType audio/ogg                             "access plus 1 month"
  510. #    ExpiresByType image/gif                             "access plus 1 month"
  511. #    ExpiresByType image/jpeg                            "access plus 1 month"
  512. #    ExpiresByType image/png                             "access plus 1 month"
  513. #    ExpiresByType video/mp4                             "access plus 1 month"
  514. #    ExpiresByType video/ogg                             "access plus 1 month"
  515. #    ExpiresByType video/webm                            "access plus 1 month"
  516. #
  517. #  # Web feeds
  518. #    ExpiresByType application/atom+xml                  "access plus 1 hour"
  519. #    ExpiresByType application/rss+xml                   "access plus 1 hour"
  520. #
  521. #  # Web fonts
  522. #    ExpiresByType application/font-woff                 "access plus 1 month"
  523. #    ExpiresByType application/vnd.ms-fontobject         "access plus 1 month"
  524. #    ExpiresByType application/x-font-ttf                "access plus 1 month"
  525. #    ExpiresByType font/opentype                         "access plus 1 month"
  526. #    ExpiresByType image/svg+xml                         "access plus 1 month"
  527.  
  528. </IfModule>
  529.  
  530. # ------------------------------------------------------------------------------
  531. # | Filename-based cache busting                                               |
  532. # ------------------------------------------------------------------------------
  533.  
  534. # If you're not using a build process to manage your filename version revving,
  535. # you might want to consider enabling the following directives to route all
  536. # requests such as `/css/style.12345.css` to `/css/style.css`.
  537. # requests such as `/version-12345/assets/css/style.css` to `/assets/css/style.css`.
  538.  
  539. # To understand why this is important and a better idea than `*.css?v231`, read:
  540. # http://stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring
  541.  
  542. # <IfModule mod_rewrite.c>
  543. #     RewriteCond %{REQUEST_FILENAME} !-f
  544. #     RewriteCond %{REQUEST_FILENAME} !-d
  545. #     RewriteRule ^(.+)/(version-\d+)/(.+)$ $1/$3 [L]
  546. # </IfModule>
  547.  
  548. # ------------------------------------------------------------------------------
  549. # | File concatenation                                                         |
  550. # ------------------------------------------------------------------------------
  551.  
  552. # Allow concatenation from within specific CSS and JS files, e.g.:
  553. # Inside of `script.combined.js` you could have
  554. #   <!--#include file="libs/jquery.js" -->
  555. #   <!--#include file="plugins/jquery.idletimer.js" -->
  556. # and they would be included into this single file.
  557.  
  558. # <IfModule mod_include.c>
  559. #    <FilesMatch "\.combined\.js$">
  560. #        Options +Includes
  561. #        AddOutputFilterByType INCLUDES application/javascript application/json
  562. #        SetOutputFilter INCLUDES
  563. #    </FilesMatch>
  564. #    <FilesMatch "\.combined\.css$">
  565. #        Options +Includes
  566. #        AddOutputFilterByType INCLUDES text/css
  567. #        SetOutputFilter INCLUDES
  568. #    </FilesMatch>
  569. # </IfModule>
  570.  
  571. # ------------------------------------------------------------------------------
  572. # | Persistent connections                                                     |
  573. # ------------------------------------------------------------------------------
  574.  
  575. # Allow multiple requests to be sent over the same TCP connection:
  576. # http://httpd.apache.org/docs/current/en/mod/core.html#keepalive.
  577.  
  578. # Enable if you serve a lot of static content but, be aware fof the
  579. # possible disadvantages!
  580.  
  581. # <IfModule mod_headers.c>
  582. #    Header set Connection Keep-Alive
  583. # </IfModule>
  584.  
  585. # BEGIN W3TC Browser Cache
  586. <IfModule mod_mime.c>
  587.     AddType text/css .css
  588.     AddType text/x-component .htc
  589.     AddType application/x-javascript .js
  590.     AddType application/javascript .js2
  591.     AddType text/javascript .js3
  592.     AddType text/x-js .js4
  593.     AddType text/html .html .htm
  594.     AddType text/richtext .rtf .rtx
  595.     AddType image/svg+xml .svg
  596.     AddType text/plain .txt
  597.     AddType text/xsd .xsd
  598.     AddType text/xsl .xsl
  599.     AddType text/xml .xml
  600.     AddType video/asf .asf .asx .wax .wmv .wmx
  601.     AddType video/avi .avi
  602.     AddType image/bmp .bmp
  603.     AddType application/java .class
  604.     AddType video/divx .divx
  605.     AddType application/msword .doc .docx
  606.     AddType application/vnd.ms-fontobject .eot
  607.     AddType application/x-msdownload .exe
  608.     AddType image/gif .gif
  609.     AddType application/x-gzip .gz .gzip
  610.     AddType image/x-icon .ico
  611.     AddType image/jpeg .jpg .jpeg .jpe
  612.     AddType image/webp .webp
  613.     AddType application/json .json
  614.     AddType application/vnd.ms-access .mdb
  615.     AddType audio/midi .mid .midi
  616.     AddType video/quicktime .mov .qt
  617.     AddType audio/mpeg .mp3 .m4a
  618.     AddType video/mp4 .mp4 .m4v
  619.     AddType video/mpeg .mpeg .mpg .mpe
  620.     AddType application/vnd.ms-project .mpp
  621.     AddType application/x-font-otf .otf
  622.     AddType application/vnd.ms-opentype ._otf
  623.     AddType application/vnd.oasis.opendocument.database .odb
  624.     AddType application/vnd.oasis.opendocument.chart .odc
  625.     AddType application/vnd.oasis.opendocument.formula .odf
  626.     AddType application/vnd.oasis.opendocument.graphics .odg
  627.     AddType application/vnd.oasis.opendocument.presentation .odp
  628.     AddType application/vnd.oasis.opendocument.spreadsheet .ods
  629.     AddType application/vnd.oasis.opendocument.text .odt
  630.     AddType audio/ogg .ogg
  631.     AddType application/pdf .pdf
  632.     AddType image/png .png
  633.     AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
  634.     AddType audio/x-realaudio .ra .ram
  635.     AddType image/svg+xml .svg .svgz
  636.     AddType application/x-shockwave-flash .swf
  637.     AddType application/x-tar .tar
  638.     AddType image/tiff .tif .tiff
  639.     AddType application/x-font-ttf .ttf .ttc
  640.     AddType application/vnd.ms-opentype ._ttf
  641.     AddType audio/wav .wav
  642.     AddType audio/wma .wma
  643.     AddType application/vnd.ms-write .wri
  644.     AddType application/font-woff .woff
  645.     AddType application/font-woff2 .woff2
  646.     AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
  647.     AddType application/zip .zip
  648. </IfModule>
  649. <IfModule mod_expires.c>
  650.     ExpiresActive On
  651.     ExpiresByType text/css A31536000
  652.     ExpiresByType text/x-component A31536000
  653.     ExpiresByType application/x-javascript A31536000
  654.     ExpiresByType application/javascript A31536000
  655.     ExpiresByType text/javascript A31536000
  656.     ExpiresByType text/x-js A31536000
  657.     ExpiresByType text/html A3600
  658.     ExpiresByType text/richtext A3600
  659.     ExpiresByType image/svg+xml A3600
  660.     ExpiresByType text/plain A3600
  661.     ExpiresByType text/xsd A3600
  662.     ExpiresByType text/xsl A3600
  663.     ExpiresByType text/xml A3600
  664.     ExpiresByType video/asf A31536000
  665.     ExpiresByType video/avi A31536000
  666.     ExpiresByType image/bmp A31536000
  667.     ExpiresByType application/java A31536000
  668.     ExpiresByType video/divx A31536000
  669.     ExpiresByType application/msword A31536000
  670.     ExpiresByType application/vnd.ms-fontobject A31536000
  671.     ExpiresByType application/x-msdownload A31536000
  672.     ExpiresByType image/gif A31536000
  673.     ExpiresByType application/x-gzip A31536000
  674.     ExpiresByType image/x-icon A31536000
  675.     ExpiresByType image/jpeg A31536000
  676.     ExpiresByType image/webp A31536000
  677.     ExpiresByType application/json A31536000
  678.     ExpiresByType application/vnd.ms-access A31536000
  679.     ExpiresByType audio/midi A31536000
  680.     ExpiresByType video/quicktime A31536000
  681.     ExpiresByType audio/mpeg A31536000
  682.     ExpiresByType video/mp4 A31536000
  683.     ExpiresByType video/mpeg A31536000
  684.     ExpiresByType application/vnd.ms-project A31536000
  685.     ExpiresByType application/x-font-otf A31536000
  686.     ExpiresByType application/vnd.ms-opentype A31536000
  687.     ExpiresByType application/vnd.oasis.opendocument.database A31536000
  688.     ExpiresByType application/vnd.oasis.opendocument.chart A31536000
  689.     ExpiresByType application/vnd.oasis.opendocument.formula A31536000
  690.     ExpiresByType application/vnd.oasis.opendocument.graphics A31536000
  691.     ExpiresByType application/vnd.oasis.opendocument.presentation A31536000
  692.     ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000
  693.     ExpiresByType application/vnd.oasis.opendocument.text A31536000
  694.     ExpiresByType audio/ogg A31536000
  695.     ExpiresByType application/pdf A31536000
  696.     ExpiresByType image/png A31536000
  697.     ExpiresByType application/vnd.ms-powerpoint A31536000
  698.     ExpiresByType audio/x-realaudio A31536000
  699.     ExpiresByType image/svg+xml A31536000
  700.     ExpiresByType application/x-shockwave-flash A31536000
  701.     ExpiresByType application/x-tar A31536000
  702.     ExpiresByType image/tiff A31536000
  703.     ExpiresByType application/x-font-ttf A31536000
  704.     ExpiresByType application/vnd.ms-opentype A31536000
  705.     ExpiresByType audio/wav A31536000
  706.     ExpiresByType audio/wma A31536000
  707.     ExpiresByType application/vnd.ms-write A31536000
  708.     ExpiresByType application/font-woff A31536000
  709.     ExpiresByType application/font-woff2 A31536000
  710.     ExpiresByType application/vnd.ms-excel A31536000
  711.     ExpiresByType application/zip A31536000
  712. </IfModule>
  713. <IfModule mod_deflate.c>
  714.         AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/bmp application/java application/msword application/vnd.ms-fontobject application/x-msdownload image/x-icon image/webp application/json application/vnd.ms-access application/vnd.ms-project application/x-font-otf application/vnd.ms-opentype application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.presentation application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text audio/ogg application/pdf application/vnd.ms-powerpoint image/svg+xml application/x-shockwave-flash image/tiff application/x-font-ttf application/vnd.ms-opentype audio/wav application/vnd.ms-write application/font-woff application/font-woff2 application/vnd.ms-excel
  715.     <IfModule mod_mime.c>
  716.         # DEFLATE by extension
  717.        AddOutputFilter DEFLATE js css htm html xml
  718.     </IfModule>
  719. </IfModule>
  720. <FilesMatch "\.(css|htc|less|js|js2|js3|js4|CSS|HTC|LESS|JS|JS2|JS3|JS4)$">
  721.     FileETag MTime Size
  722.     <IfModule mod_headers.c>
  723.         Header set Pragma "public"
  724.         Header append Cache-Control "public"
  725.          Header set X-Powered-By "W3 Total Cache/0.9.6"
  726.     </IfModule>
  727. </FilesMatch>
  728. <FilesMatch "\.(html|htm|rtf|rtx|svg|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|SVG|TXT|XSD|XSL|XML)$">
  729.     FileETag MTime Size
  730.     <IfModule mod_headers.c>
  731.         Header append Vary User-Agent env=!dont-vary
  732.         Header set Pragma "public"
  733.         Header append Cache-Control "public"
  734.          Header set X-Powered-By "W3 Total Cache/0.9.6"
  735.     </IfModule>
  736. </FilesMatch>
  737. <FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|webp|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|_ttf|wav|wma|wri|woff|woff2|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EOT|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|WEBP|JSON|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|OTF|_OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SVG|SVGZ|SWF|TAR|TIF|TIFF|TTF|TTC|_TTF|WAV|WMA|WRI|WOFF|WOFF2|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
  738.     FileETag MTime Size
  739.     <IfModule mod_headers.c>
  740.         Header set Pragma "public"
  741.         Header append Cache-Control "public"
  742.          Header set X-Powered-By "W3 Total Cache/0.9.6"
  743.     </IfModule>
  744. </FilesMatch>
  745. <FilesMatch "\.(bmp|class|doc|docx|eot|exe|ico|webp|json|mdb|mpp|otf|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|pot|pps|ppt|pptx|svg|svgz|swf|tif|tiff|ttf|ttc|_ttf|wav|wri|woff|woff2|xla|xls|xlsx|xlt|xlw|BMP|CLASS|DOC|DOCX|EOT|EXE|ICO|WEBP|JSON|MDB|MPP|OTF|_OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|POT|PPS|PPT|PPTX|SVG|SVGZ|SWF|TIF|TIFF|TTF|TTC|_TTF|WAV|WRI|WOFF|WOFF2|XLA|XLS|XLSX|XLT|XLW)$">
  746.     <IfModule mod_headers.c>
  747.          Header unset Last-Modified
  748.     </IfModule>
  749. </FilesMatch>
  750. # END W3TC Browser Cache
  751. # BEGIN W3TC Page Cache core
  752. <IfModule mod_rewrite.c>
  753.     RewriteEngine On
  754.     RewriteBase /
  755.     RewriteCond %{HTTPS} =on
  756.     RewriteRule .* - [E=W3TC_SSL:_ssl]
  757.     RewriteCond %{SERVER_PORT} =443
  758.     RewriteRule .* - [E=W3TC_SSL:_ssl]
  759.     RewriteCond %{HTTP:X-Forwarded-Proto} =https [NC]
  760.     RewriteRule .* - [E=W3TC_SSL:_ssl]
  761.     RewriteCond %{HTTP:Accept-Encoding} gzip
  762.     RewriteRule .* - [E=W3TC_ENC:_gzip]
  763.     RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
  764.     RewriteRule .* - [E=W3TC_PREVIEW:_preview]
  765.     RewriteCond %{REQUEST_METHOD} !=POST
  766.     RewriteCond %{QUERY_STRING} =""
  767.     RewriteCond %{REQUEST_URI} \/$
  768.     RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|w3tc_logged_a93c7e6e52fb321bf602101d361185dd|w3tc_logged_177e8d3501fe5c7986689b5660ad8de9|w3tc_logged_bbba88bec25d11c5b0fc9a41f397dada|w3tc_logged_ccd86e7ed7d75736af7562d70b628bc6|wptouch_switch_toggle) [NC]
  769.     RewriteCond "%{DOCUMENT_ROOT}/content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f
  770.     RewriteRule .* "/content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L]
  771.     RewriteCond %{REQUEST_METHOD} !=POST
  772.     RewriteCond %{QUERY_STRING} =""
  773.     RewriteCond %{REQUEST_URI} \/$
  774.     RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|w3tc_logged_a93c7e6e52fb321bf602101d361185dd|w3tc_logged_177e8d3501fe5c7986689b5660ad8de9|w3tc_logged_bbba88bec25d11c5b0fc9a41f397dada|w3tc_logged_ccd86e7ed7d75736af7562d70b628bc6|wptouch_switch_toggle) [NC]
  775.     RewriteCond "%{DOCUMENT_ROOT}/content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.xml%{ENV:W3TC_ENC}" -f
  776.     RewriteRule .* "/content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.xml%{ENV:W3TC_ENC}" [L]
  777. </IfModule>
  778. # END W3TC Page Cache core
  779. # BEGIN WordPress
  780. <IfModule mod_rewrite.c>
  781. RewriteEngine On
  782. RewriteBase /
  783. RewriteRule ^index\.php$ - [L]
  784. RewriteCond %{REQUEST_FILENAME} !-f
  785. RewriteCond %{REQUEST_FILENAME} !-d
  786. RewriteRule . /index.php [L]
  787. </IfModule>
  788.  
  789. # END WordPress
  790.  
  791.  
  792. # Wordfence WAF
  793. <IfModule mod_php5.c>
  794.     php_value auto_prepend_file '/home/pxdz389314/domains/freerides.org/public_html/wp/wordfence-waf.php'
  795. </IfModule>
  796. <Files ".user.ini">
  797. <IfModule mod_authz_core.c>
  798.     Require all denied
  799. </IfModule>
  800. <IfModule !mod_authz_core.c>
  801.     Order deny,allow
  802.     Deny from all
  803. </IfModule>
  804. </Files>
  805.  
  806. # END Wordfence WAF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement