Welcome to SEO Unity!

SEO Unity is an active community of SEO members. We provide a unique platform for you to learn and share ideas about search engine optimization, marketing, and how to make money online. Signup today and start interacting with other SEO experts around the world and get free access to premium SEO tools.

Create a Free Account

How To Tweak .htaccess To Increase Website Speed to Improve SEO Ranking Without Gzip or Deflate

Discussion in 'SEO Chatroom' started by Alex Anderson, Oct 3, 2015.

  1. Alex Anderson

    Alex Anderson New Member

    Sep 4, 2015
    Likes Received:
    .htaccess should be as follows:

    AddType x-mapp-php6 .html .htm .php .js
    ExpiresActive On
    ExpiresByType image/gif "access plus 2 weeks"
    ExpiresByType image/jpeg "access plus 2 weeks"
    ExpiresByType image/png "access plus 2 weeks"
    ExpiresByType image/ico "access plus 2 weeks"
    ExpiresByType text/css "access plus 2 weeks"
    ExpiresByType text/javascript "access plus 2 weeks"
    ExpiresByType application/x-javascript "access plus 2 weeks"

    php.ini should be as follows:

    zlib.output_compression = On
    zlib.output_compression_level = 9

    Note: This was the problem I experienced with 1and1 hosting. I was so happy after I solved this problem since 1and1 customer support could not fix my problem. You can check your website speed at google page speed insights at https://developers.google.com/speed/pagespeed/insights/. I recommend you to check your website speed before and after you put the code so you can see the difference.

    The most popular compression techniques are gzip and deflate. If your website supports compression like Godaddy web hosting, you don't need to have php.ini. Then, your .htaccess should be as follows:

    <IfModule mod_expires.c>
    # Enable expirations
    ExpiresActive On
    # Default directive
    ExpiresDefault "access plus 1 month"
    # My favicon
    ExpiresByType image/x-icon "access plus 1 year”
    # Images
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    # CSS
    ExpiresByType text/css "access 1 month”
    # Javascript
    ExpiresByType application/javascript "access plus 1 year"

    Also, you can tweak .htaccess if you have an hosting account that has an Apache server. Some hosting companies will not let you to play with .htaccess file even though they have Apache server, so be careful what hosting account you will get.

    Another problem with 1and1 was that their built-in redirect was not permanent 301 redirect. It was 302 temporary redirect which is not as good as 301 due to SEO perspective. I solved this problem, too. I'll talk about this on my next thread.

    Please feel free to ask me any question. Thanks.
  2. anijohn1318

    anijohn1318 New Member

    Oct 27, 2015
    Likes Received:
    it was really works .. thanks for this

Share This Page