adrienlementheour/AliceRouat/master/.htaccess - Htaccess File

adrienlementheour/AliceRouat/master/.htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

<IfModule mod_rewrite.c>
    RewriteEngine On
    # Protect wp-includes
    RewriteRule ^wp-admin/includes/ - [F]
    RewriteRule !^wp-includes/ - [S=3]
    RewriteCond %{SCRIPT_FILENAME} !^(.*)wp-includes/ms-files.php
    RewriteRule ^wp-includes/[^/]+.php$ - [F]
    RewriteRule ^wp-includes/js/tinymce/langs/.+.php - [F]
    RewriteRule ^wp-includes/theme-compat/ - [F]
    # Disable PHP in Uploads
    RewriteRule ^wp-content/uploads/.*.(?:php[1-6]?|pht|phtml?)$ - [NC,F]
    # Filter Request Methods
    RewriteCond %{REQUEST_METHOD} ^(TRACE|DELETE|TRACK) [NC]
    RewriteRule ^.* - [F]
</IfModule>

# autoriser la compression gzip SI DEFLATE NE FONCIONNE PAS
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.​*gzip.*​
</ifModule>

# Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"

ExpiresByType text/css "access plus 604800 seconds"

ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType application/xml "access plus 7200 seconds"
ExpiresByType text/xml "access plus 7200 seconds"
ExpiresByType application/json "access plus 7200 seconds"
ExpiresByType application/xhtml+xml "access plus 7200 seconds"

ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType application/javascript "access plus 604800 seconds"
ExpiresByType application/x-javascript "access plus 604800 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"

ExpiresByType application/atom+xml "access plus 1 hour"
ExpiresByType application/rss+xml "access plus 1 hour"

ExpiresByType image/jpg "access plus 1 months"
ExpiresByType image/jpeg "access plus 1 months"
ExpiresByType image/png "access plus 1 months"
ExpiresByType image/gif "access plus 1 months"
AddType image/x-icon .ico
ExpiresByType image/ico "access plus 1 months"
ExpiresByType image/icon "access plus 1 months"
ExpiresByType image/x-icon "access plus 1 months"

ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/font-woff2 "access plus 1 month"
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
</IfModule>

# Cache-Control Headers
<Ifmodule mod_headers.c>
BrowserMatch MSIE is-msie
Header set X-UA-Compatible IE=edge env=is-msie
Header unset ETag
Header set vary "Accept-Encoding"
Header append vary "User-Agent"
Header append Cache-Control "public" 
Header append Connection "Keep-Alive"
Header append Keep-Alive "timeout=5, max=100"
<FilesMatch ".(ico|jpe?g|png|gif|swf|gz|ttf|svg|eot|woff|pdf|mp4|mpeg|avi|svg|woff2)$">
Header set Cache-Control "max-age=31536000"
</FilesMatch>
<filesmatch ".(css|js)$">
Header set Cache-Control "max-age=604800, public"
</filesmatch>
<filesmatch ".(html|htm)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</filesmatch>
<filesmatch ".(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</filesmatch>
# disallow site to be in iframe or clickjacking attack
Header always set X-FRAME-OPTIONS SAMEORIGIN
</Ifmodule>

# KILL ETAGS
FileETag none

<files .htaccess>
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</files>
<files readme.html>
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</files>
<files readme.txt>
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</files>
<files install.php>
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</files>
<files wp-config.php>
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</files>

Options -Indexes

On Github License

Files

Download PDF of Htaccess file
DEFLATE, ORIGIN, REQUEST_FILENAME, REQUEST_METHOD, SCRIPT_FILENAME

Comments

Apache