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
    Offline

    Alex Anderson New Member

    • New Member
    Joined:
    Sep 4, 2015
    Messages:
    7
    Likes Received:
    0
    .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"
    </IfModule>

    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.
     
    #1
  2. anijohn1318
    Offline

    anijohn1318 New Member

    • New Member
    Joined:
    Oct 27, 2015
    Messages:
    2
    Likes Received:
    0
    it was really works .. thanks for this
     
    #2

Share This Page