jpolete/springboard/master/starters/sample.htaccess - Htaccess File

jpolete/springboard/master/starters/sample.htaccess

Options +FollowSymLinks

# Most of this is taken from h5bp examples here...
# https://github.com/h5bp/server-configs-apache/blob/master/dist/.htaccess

# Redirect to HTTPS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# RewriteCond %{HTTPS} !=on
# RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>

# Strip www from url for consistency and SEO concerns.
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
    RewriteRule ^ %{ENV:PROTO}://%1%{REQUEST_URI} [R=301,L]
</IfModule>

#==============================================================================
# WordPress Pretty URLs 
# RewriteRule ^index.php$ - [L]

# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule . /index.php [L]
#==============================================================================

<IfModule mod_php5.c>

#==============================================================================
# Override some PHP defaults

# php_value post_max_size        20M
# php_value upload_max_filesize  20M
# php_value memory_limit         500M
# php_value SMTP                 localhost
# php_value smtp_port            25
# php_value sendmail_from        mail@example.com
#==============================================================================

# Send mail to catchmail for development 
# (Find catchmail path with `which catchmail`)
# http://berk.es/2011/05/29/mailcatcher-for-drupal-and-other-php-applications-the-simple-version
# php_value sendmail_path        /usr/bin/env /Users/jasonpolete/.rvm/gems/ruby-1.9.3-p194@global/bin/catchmail

</IfModule>

<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType image/ico "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/javascript "access plus 1 day"
ExpiresByType text/css "access plus 1 day"
</IfModule>

<IfModule mod_filter.c>
      AddOutputFilterByType DEFLATE "application/atom+xml" 
                                    "application/javascript" 
                                    "application/json" 
                                    "application/ld+json" 
                                    "application/manifest+json" 
                                    "application/rdf+xml" 
                                    "application/rss+xml" 
                                    "application/schema+json" 
                                    "application/vnd.geo+json" 
                                    "application/vnd.ms-fontobject" 
                                    "application/x-font-ttf" 
                                    "application/x-javascript" 
                                    "application/x-web-app-manifest+json" 
                                    "application/xhtml+xml" 
                                    "application/xml" 
                                    "font/eot" 
                                    "font/opentype" 
                                    "image/bmp" 
                                    "image/svg+xml" 
                                    "image/vnd.microsoft.icon" 
                                    "image/x-icon" 
                                    "text/cache-manifest" 
                                    "text/css" 
                                    "text/html" 
                                    "text/javascript" 
                                    "text/plain" 
                                    "text/vcard" 
                                    "text/vnd.rim.location.xloc" 
                                    "text/vtt" 
                                    "text/x-component" 
                                    "text/x-cross-domain-policy" 
                                    "text/xml"

  </IfModule>

On Github License

Files

Download PDF of Htaccess file
DEFLATE, ENV, HTTP_HOST, HTTPS, PROTO, REQUEST_FILENAME, REQUEST_URI

Comments

Apache