ChristianSiegert/sunlightphp/master/.htaccess
# Do not show footer line under Apache-generated documents
ServerSignature Off
Options FollowSymLinks
# Set charset for text/html and text/plain
AddDefaultCharset UTF-8
# Set charset by file extenion
AddCharset UTF-8 .css
AddCharset UTF-8 .js
# Reduce directory index look-ups to one file
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
# Enable compression for text files
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript application/json application/x-javascript application/xml application/xml+rss image/bmp text/css text/html text/javascript text/js text/plain text/xml
</IfModule>
# Set expiration date for static files
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-javascript "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType text/js "access plus 1 year"
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent
Header unset X-Powered-By
<FilesMatch ".(css|gif|ico|jpg|jpeg|js|png)$">
Header set Cache-Control "public"
Header unset Last-Modified
</FilesMatch>
</IfModule>
<IfModule mod_rewrite.c>
# Replace "example.com" with your domain name.
# Replace "sunlightphp" with your app's directory name.
# Replace "127.0.0.1" with your server's ip address.
RewriteEngine On
# Block bad user agents
RewriteCond %{HTTP_USER_AGENT} HTTrack
RewriteRule .* - [forbidden,last]
# Remove www prefix
RewriteCond %{HTTP_HOST} ^www. [nocase]
RewriteRule (.*) http://example.com/sunlightphp/$1 [redirect=301,last]
# SunlightPHP's rules
RewriteCond %{DOCUMENT_ROOT}/sunlightphp/maintenance_mode_on -f
RewriteCond %{REMOTE_ADDR} !^127.0.0.1$
RewriteRule .* maintenance/down.php [last]
RewriteCond %{REQUEST_FILENAME} !maintenance/maintenance.php$
RewriteRule (.*) app/webroot/$1 [last]
</IfModule>
On Github License
Files
Download PDF of Htaccess file