NguyenQuiDuong/Funixtest/master/public/.htaccess - Htaccess File

NguyenQuiDuong/Funixtest/master/public/.htaccess

SetEnv APPLICATION_ENV production
RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
RewriteRule .* – [F,L]

# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteRule .(phtml)$  /index.php [NC,L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

# The following rewrites all other queries to index.php. The 
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to 
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size 
# fits all solution.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]

# 
# associate .js with "text/javascript" type (if not present in mime.conf)
# 
AddType text/javascript .js

# 
# configure mod_expires
# URL: http://httpd.apache.org/docs/2.2/mod/mod_expires.html
# 10 days = 3600 * 24 * 10 = 864000 
# 30 days = 3600 * 24 * 10 = 2592000
#
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 5 seconds"
    ExpiresByType image/x-icon "access plus 864000 seconds"
    ExpiresByType image/jpeg "access plus 864000 seconds"
    ExpiresByType image/png "access plus 864000 seconds"
    ExpiresByType image/gif "access plus 864000 seconds"
    ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
    ExpiresByType text/css "access plus 2592000 seconds"
    ExpiresByType text/javascript "access plus 2592000 seconds"
    ExpiresByType application/x-javascript "access plus 2592000 seconds"
#    ExpiresByType text/html "access plus 10 seconds"
#    ExpiresByType application/xhtml+xml "access plus 10 seconds"
</IfModule>

# 
# configure mod_headers
# URL: http://httpd.apache.org/docs/2.2/mod/mod_headers.html
#
<IfModule mod_headers.c>
    <FilesMatch "\.(ico|jpe?g|png|gif|swf)$">
        Header set Cache-Control "max-age=864000, public"
    </FilesMatch>
    <FilesMatch "\.(css|js)$">
        Header set Cache-Control "max-age=2592000, public"
    </FilesMatch>
#    <FilesMatch "\.(x?html?|php)$">
#        Header set Cache-Control "max-age=10, private, must-revalidate"
#    </FilesMatch>
    Header unset ETag
    Header unset Last-Modified
</IfModule>

On Github License

Files

Download PDF of Htaccess file
ENV, HTTP_USER_AGENT, REQUEST_FILENAME, REQUEST_URI

Comments

Apache