Optimized .htaccess for Interspire Shopping Cart

php_flag magic_quotes_gpc Off
Options -MultiViews +FollowSymlinks +Indexes
IndexIgnore *
ErrorDocument 401 "Unauthorized access"

<IfModule mod_security.c>
	SecFilterEngine Off
	SecFilterScanPOST Off
</IfModule>

<IfModule mod_rewrite.c>
	RewriteEngine On

	RewriteCond %{HTTPS} !=on [NC]
	RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

	RewriteCond %{REQUEST_FILENAME} robots.txt
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteRule robots.txt robots_default.txt [L]

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule . index.php
	<IfModule mod_env.c>
		SetEnv SEO_SUPPORT 1
	</IfModule>
</IfModule>

<IfModule mod_deflate.c>
	AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
	AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
	AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
	AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
	AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
	AddOutputFilterByType DEFLATE font/truetype font/opentype
</IfModule>

<ifModule mod_expires.c>
	ExpiresActive On
	ExpiresByType image/x-icon "access plus 1 month"
	ExpiresByType image/jpeg "access plus 1 month"
	ExpiresByType image/png "access plus 1 month"
	ExpiresByType image/gif "access plus 1 month"
	ExpiresByType text/css "access plus 1 month"
	ExpiresByType text/javascript "access plus 1 month"
	ExpiresByType application/javascript "access plus 1 month"
	ExpiresByType application/x-javascript "access plus 1 month"
	ExpiresByType text/html "access plus 30 minutes"
	ExpiresByType application/xhtml+xml "access plus 30 minutes"
</ifModule>

<ifModule mod_headers.c>
	Header always set Strict-Transport-Security "max-age=31536000" env=HTTPS
	Header unset ETag
	Header append Vary User-Agent
	FileETag None

  <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
    Header set Cache-Control "public"
  </filesMatch>
  <filesMatch "\.(css)$">
    Header set Cache-Control "public"
  </filesMatch>
  <filesMatch "\.(js)$">
    Header set Cache-Control "private"
  </filesMatch>
  <filesMatch "\.(x?html?|php)$">
    Header set Cache-Control "private, must-revalidate"
  </filesMatch>
</ifModule>

Leave a Reply

Your email address will not be published. Required fields are marked *