core-framework/core-framework/master/web/.htaccess - Htaccess File

core-framework/core-framework/master/web/.htaccess

AddDefaultCharset UTF-8
DefaultLanguage en-US

#### REWRITE
<IfModule mod_rewrite.c>

    RewriteEngine On

    #### Forcing HTTPS (uncomment these lines if HTTPS is required)
    #RewriteCond %{HTTPS} !on [AND]
    #RewriteCond %{SERVER_PORT} 80
    #RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    #### Redirect Trailing Slashes If Not A Folder
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Front Controller
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([a-zA-Z0-9_-/.]+)$ index.php?page=$1 [L,QSA]

    #### OTHERS
    #### Allow resource OR file access to only your domain (Edit as required)
    #RewriteCond %{HTTP_REFERER} !^$
    #RewriteCond %{REQUEST_URI} !^/(wp-login.php|wp-admin/|wp-content/plugins/|wp-includes/).* [NC]
    #RewriteCond %{HTTP_REFERER} !^http://(www.)?coreframework.in.*$ [NC]
    #RewriteRule .(ico|pdf|flv|jpg|jpeg|mp3|mpg|mp4|mov|wav|wmv|png|gif|swf|css|js)$ - [F,NS,L]

    #### Multiviews
    # http://stackoverflow.com/questions/25423141/what-exactly-does-the-the-multiviews-options-in-htaccess
    #<IfModule mod_negotiation.c>
    #    Options -MultiViews
    #</IfModule>

    #### CORS access control
    #<IfModule mod_headers.c>
    #    Header set Access-Control-Allow-Origin "*"
    #</IfModule>

</IfModule>

#### Deflate
<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
            ### Unset ETag
            Header unset ETag
        </IfModule>
    </IfModule>

    # 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 $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/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
    </IfModule>
</IfModule>

#### EXPIRES (change as required)
<IfModule mod_expires.c>
    #### Media and Fonts
    <FilesMatch ".(jpg|jpeg|png|gif|swf|ico|woff|ttf|mp3)$">
        ExpiresActive on
        ExpiresDefault "access plus 1 year"
    </FilesMatch>

    #### Resources
    <FilesMatch ".(js|css|html)$">
        ExpiresActive on
        ExpiresDefault "access plus 1 days"
    </FilesMatch>
</IfModule>

#### Want to access bower_components folder?? Copy past the below code to your vhost file under the websites' <VirtualHost> tag
#### PLEASE NOTE : UNCOMMENTING THE BELOW LINES WONT WORK AND WILL GIVE YOU AN INTERNAL SERVER ERROR
#### EDIT PATHS AS REQUIRED
#alias /bower_components/ "/path/to/project/bower_components/"
#
#<Directory "/path/to/project/bower_components">
#        Allow From All
#        AllowOverride None
#        Order allow,deny
#        Options Indexes MultiViews FollowSymLinks
#        Require all granted
#</Directory>

On Github License

Files

Download PDF of Htaccess file
DEFLATE, HTTP_HOST, HTTP_REFERER, HTTPS, REQUEST_FILENAME, REQUEST_URI, SERVER_PORT

Comments

Apache