Skip to content

Instantly share code, notes, and snippets.

@staminaloops
Last active August 29, 2015 14:23
Show Gist options
  • Save staminaloops/394914d542a1c7d69ef7 to your computer and use it in GitHub Desktop.
Save staminaloops/394914d542a1c7d69ef7 to your computer and use it in GitHub Desktop.
HTTP, robots.txt, sitemap.xml
#Force www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^monte-ameira.com [NC]
RewriteRule ^(.*)$ http://www.monte-ameira.com/$1 [L,R=301,NC]
##REMOVE .html from url
RewriteEngine on
RewriteBase /
RewriteCond %{http://http://www.monte-ameira.com} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^.]+)\.html$ http://www.monte-ameira.com/$1 [R=301,L]
#DISABLE DIRECTORY BROWSER
Options All -Indexes
##HEADERS FOR BROWSER CACHE
# BEGIN EXPIRES
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 10 days"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/plain "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-icon "access plus 1 year"
</IfModule>
# END EXPIRES
## OR ##
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##
# robotstxt.org/
User-Agent: *
Disallow: /booking-for-monte-ameira
Disallow: /cms-monte-ameira
Disallow: /sitecake
Disallow: /sitecake-backup
Disallow: /sitecake-temp
Sitemap: http://www.monte-ameira.com/sitemap.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment