cancel
Showing results for 
Search instead for 
Did you mean: 

need to configure .htaccess for optimum page speed

need to configure .htaccess for optimum page speed

Hoping someone can help me with this. I purchased a Magento template and customised it, believing that it would be a time saver (I was sorely mistaken) and in the last few days having been trying to take measures to improve the site speed through the .htaccess file. The existing .htaccess and htaccess.sample.txt files in the root directory that came with the template are completely empty however. I'm not overly familiar with the Magento as you might have guessed and was wondering if anyone can help me accomplish the following through the .htaccess file:

1. redirect non www to www.
2. remove index.php from all urls
3. redirect www.seavite.ie/index.php to www.seavite.ie 
4. leverage browser caching
5. enable gzip compression

So far I've managed to achieve items 1 and 2 but don't feel overly confident about how I went about doing it. Below is what I currently have on the .htaccess file.

Thanks in advance for the help.

RewriteEngine On

RewriteCond %{HTTP_HOST} ^seavite\.ie$ [NC]

RewriteRule ^(.*)$ http://www.seavite.ie/$1 [R=301,L]

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# Redirect index.php to Root
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^index\.php$ http%2://www.seavite.ie/ [R=301,L]

ErrorDocument 404 http://www.seavite.ie/

Redirect 301 /index.php/seavite-products.html http://www.seavite.ie/seavite-products.html
Redirect 301 /index.php/our-story http://www.seavite.ie/our-story
Redirect 301 /index.php/stockists http://www.seavite.ie/stockists
Redirect 301 /index.php/our-story http://www.seavite.ie/our-story
Redirect 301 /index.php/contact-us http://www.seavite.ie/contact-us
Redirect 301 /index.php/super-nutrient-comfort-cleanser.html http://www.seavite.ie/super-nutrient-comfort-cleanser.html
Redirect 301 /index.php/super-nutrient-soothing-and-replenishing-face-cream.html http://www.seavite.ie/super-nutrient-soothing-and-replenishing-face-cream.html
Redirect 301 /index.php/super-nutrient-hydrating-face-lotion.html http://www.seavite.ie/super-nutrient-hydrating-face-lotion.html
Redirect 301 /index.php/super-nutrient-radiance-face-serum.html http://www.seavite.ie/super-nutrient-radiance-face-serum.html
Redirect 301 /index.php/super-nutrient-toning-sea-spray.html http://www.seavite.ie/super-nutrient-toning-sea-spray.html
Redirect 301 /index.php/super-nutrient-revitalising-bath-and-shower-gel.html http://www.seavite.ie/super-nutrient-revitalising-bath-and-shower-gel.html
Redirect 301 /index.php/super-nutrient-intense-moisture-body-cream.html http://www.seavite.ie/super-nutrient-intense-moisture-body-cream.html
Redirect 301 /index.php/super-nutrient-firming-and-toning-body-lotion.html http://www.seavite.ie/super-nutrient-firming-and-toning-body-lotion.html
Redirect 301 /index.php/super-nutrient-illuminating-and-firming-body-exfoliator.html http://www.seavite.ie/super-nutrient-illuminating-and-firming-body-exfoliator.html
Redirect 301 /index.php/super-nutrient-purifying-and-volumising-shampoo.html http://www.seavite.ie/super-nutrient-purifying-and-volumising-shampoo.html
Redirect 301 /index.php/seavite-travel-kit.html http://www.seavite.ie/seavite-travel-kit.html
Redirect 301 /index.php/seavite-products/skin-care.html http://www.seavite.ie/seavite-products/skin-care.html
Redirect 301 /index.php/seavite-products/body-care.html http://www.seavite.ie/seavite-products/body-care.html
Redirect 301 /index.php/seavite-products/hair-care.html http://www.seavite.ie/seavite-products/hair-care.html
Redirect 301 /seavite-products/Belfast-Telegraph-September-2015-2.pdf http://www.seavite.ie
Redirect 301 /skin/frontend/default/galawintertime/images/slide_bg.png http://www.seavite.ie
Redirect 301 /checkout/cart/Belfast-Telegraph-September-2015-2.pdf http://www.seavite.ie
Redirect 301 /catalogsearch/result/Belfast-Telegraph-September-2015-2.pdf http://www.seavite.ie
Redirect 301 /index.php/skin-advice http://www.seavite.ie/skin-advice
Redirect 301 /index.php/all-natural-ingredients http://www.seavite.ie/all-natural-ingredients
Redirect 301 /index.php/testimonials http://www.seavite.ie/testimonials
Redirect 301 /index.php/press http://www.seavite.ie/press





4 REPLIES 4

Re: need to configure .htaccess for optimum page speed

This is a generic starting point for a Magento .htaccess, it contains all the mod_deflate, gzip, expires, etc.

 

Tweak it to your liking...

 

https://github.com/Creare/magento-htaccess/blob/master/.htaccess

 

 

Re: need to configure .htaccess for optimum page speed

there is nothing in .htaccess file you can do to speedup pages loading time, etc

 

you need to install aoe_profiler and test your pages, then you will see whats going on

------------
MagenX - Magento and Server optimization

Re: need to configure .htaccess for optimum page speed

Thanks Lewisa, I transferred that across and replaced www.yourdomain.com where applicable, but I'm getting a 500 internal server error message. Any idea where I might be going wrong?
Thanks again

Re: need to configure .htaccess for optimum page speed

Thanks for coming back to me Magenx, I know it won't have a dramatic effect on actual load time but I was going by what was recommended on the Google Page speed insights report. I want to try and bring up the score if possible.