Htaccess File


# Restricted access to files
<FilesMatch "((.(lock|cache|db))|installed.json|composer.json|package.json|bower.json|||gulpfile.js|webpack.config.js)$">
    Order allow,deny

# Don't show directory listings
Options -Indexes

# URL rewrites
<IfModule mod_rewrite.c>

    Options -MultiViews

    RewriteEngine On

    # Set base if your site is running in a VirtualDocumentRoot
    # RewriteBase /

    # Redirect requests to access the site with the 'www.' prefix
    # RewriteCond %{HTTP_HOST} .
    # RewriteCond %{HTTP_HOST} !^www. [NC]
    # RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    # Redirect requests to access the site without the 'www.' prefix
    # RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
    # RewriteRule ^ https://%1%{REQUEST_URI} [L,R=301]

    # Redirect requests to access the site with HTTPS
    # RewriteCond %{HTTPS} off
    # RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R]

    # Rewrite request to use the index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [L]

    <IfModule mod_env.c>
        SetEnv HTTP_MOD_REWRITE On

    <IfModule mod_headers.c>
        RequestHeader set MOD_REWRITE "On"


# Redirect admin URL, if rewrite is not enabled
<IfModule !mod_rewrite.c>
    <IfModule mod_alias.c>

        RedirectMatch (.*)(?<!index.php)/admin$ $1/index.php/admin


# Media types
<IfModule mod_mime.c>

    AddType image/svg+xml svg svgz

    <IfModule mod_deflate.c>
        AddEncoding gzip svgz


# Avoid PHP 5.6 deprecated $HTTP_RAW_POST_DATA warnings
<IfModule mod_php5.c>
    php_value always_populate_raw_post_data -1
Exit mobile version