ariela/myfront/master/.htaccess - Htaccess File

ariela/myfront/master/.htaccess

# インデックス表示順設定
DirectoryIndex index.php index.html

# 動作設定
Options +FollowSymLinks -Indexes

# URL制御
<IfModule mod_rewrite.c>
    RewriteEngine on

    # gzファイルが存在する場合にはgzファイルを優先表示
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{REQUEST_FILENAME} !.gz$
    RewriteCond %{REQUEST_FILENAME}.gz -s
    RewriteRule .+ %{REQUEST_URI}.gz

    # javascript 圧縮対応
    <FilesMatch ".js.gz$">
        ForceType application/x-javascript
        AddEncoding x-gzip .gz
    </FilesMatch>

    # css 圧縮対応
    <FilesMatch ".css.gz$">
        ForceType text/css
        AddEncoding x-gzip .gz
    </FilesMatch>
</IfModule>

# キャッシュ設定
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 seconds"
    ExpiresByType text/html "access plus 1 seconds"
    ExpiresByType text/css "access plus 7 days"
    ExpiresByType text/javascript "access plus 7 days"
    ExpiresByType application/x-javascript "access plus 7 days"
    ExpiresByType image/gif "access plus 30 days"
    ExpiresByType image/jpg "access plus 30 days"
    ExpiresByType image/jpeg "access plus 30 days"
    ExpiresByType image/pjpeg "access plus 30 days"
    ExpiresByType image/png "access plus 30 days"
    ExpiresByType image/x-png "access plus 30 days"
    ExpiresByType image/x-icon "access plus 30 days"
</IfModule>

# 圧縮設定
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/x-httpd-php
    AddOutputFilterByType DEFLATE application/x-httpd-fastphp
    AddOutputFilterByType DEFLATE image/svg+xml

    # 非対応ブラウザはDEFLATE無効
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4.0[678] no-gzip
    BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html

    # 画像の圧縮は行わない
    SetEnvIfNoCase Request_URI ".(?:gif|jpe?g|png)$" no-gzip dont-vary

    Header append Vary User-Agent env=!dont-vary
</IfModule>

# 非公開ファイルのアクセス制限
<Files .*>
    Order Deny,Allow
    Deny From All
</Files>
<FilesMatch "/?src">
    Order Deny,Allow
    Deny From All
</FilesMatch>
<FilesMatch "/?build">
    Order Deny,Allow
    Deny From All
</FilesMatch>
<Files "bower.json">
    Order Deny,Allow
    Deny From All
</Files>
<Files "package.json">
    Order Deny,Allow
    Deny From All
</Files>
<Files "gulpfile.*">
    Order Deny,Allow
    Deny From All
</Files>
<Files "LICENSE">
    Order Deny,Allow
    Deny From All
</Files>
<Files "README.md">
    Order Deny,Allow
    Deny From All
</Files>

On Github License

Files

Download PDF of Htaccess file
DEFLATE, no-gzip, REQUEST_FILENAME, REQUEST_URI

Comments

Apache