phoenixz/base/master/www/en/.htaccess - Htaccess File

phoenixz/base/master/www/en/.htaccess

RewriteEngine On

Options -Multiviews

ErrorDocument 404 /404.php

# Mobile pages are not directly accessible
RewriteRule ^mobile/(.+)$ /404.php [NC,L]

# All .html pages go straight to PHP
RewriteRule ^([a-z0-9-_]+?).html$ /$1.php [NC,L]

# Remove all double slashes
RewriteCond %{THE_REQUEST}  (.*)//+(.*)  [NC]
RewriteRule .* %1/%2 [R=301,L]

# Redirect html pages to the root domain
RewriteRule ^index.html$ / [NC,R=301,L]

# Mailer access images
RewriteRule ^logoimgs/(.+).png/$ /ajax/base/mailer_viewed.php?code=$1 [NC,L]

# ----------------------------------------------------------------------
# Apache caching
# ----------------------------------------------------------------------
FileETag MTime Size

# Cache exprires in a week
Header set Cache-Control "max-age=604800, public, must-revalidate"

ExpiresActive On
ExpiresDefault A604800

# ----------------------------------------------------------------------
# Gzip compression
# ----------------------------------------------------------------------
<IfModule mod_deflate.c>
    # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
    <IfModule mod_setenvif.c>
        <IfModule mod_headers.c>
            SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)s*,?s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
            RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
        </IfModule>
    </IfModule>

    <IfVersion >= 2.4>
        # this happens only in versions greater or equal 2.4.0.
        # HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
        <IfModule filter_module>
            FilterDeclare   COMPRESS
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'text/html'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'text/css'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'text/plain'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'text/xml'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'text/x-component'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'application/javascript'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'application/json'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'application/xml'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'application/xhtml+xml'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'application/rss+xml'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'application/atom+xml'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'application/vnd.ms-fontobject'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'image/svg+xml'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'image/x-icon'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'application/x-font-ttf'"
            FilterProvider  COMPRESS  DEFLATE "%{CONTENT_TYPE} = 'font/opentype'"
            FilterChain     COMPRESS
            FilterProtocol  COMPRESS  DEFLATE change=yes;byteranges=no
        </IfModule>
    </IfVersion>

    <IfVersion < 2.4>
        # this happens only in versions lower than 2.4.0.
        # HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
        <IfModule filter_module>
            FilterDeclare   COMPRESS
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/html
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/css
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/plain
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/xml
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/x-component
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/javascript
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/json
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xml
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xhtml+xml
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/rss+xml
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/atom+xml
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/vnd.ms-fontobject
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $image/svg+xml
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $image/x-icon
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/x-font-ttf
            FilterProvider  COMPRESS  DEFLATE resp=Content-Type $font/opentype
            FilterChain     COMPRESS
            FilterProtocol  COMPRESS  DEFLATE change=yes;byteranges=no
        </IfModule>

        <IfModule !mod_filter.c>
            # Legacy versions of Apache
            AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
            AddOutputFilterByType DEFLATE application/javascript
            AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
            AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
            AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
        </IfModule>
    </IfVersion>
</IfModule>

On Github License

Files

Download PDF of Htaccess file
CONTENT_TYPE, DEFLATE, THE_REQUEST

Comments

Apache