How To Speed Up WordPress Site With .htaccess Tricks And Get More Impact On Google

How To Speed Up WordPress Site With .htaccess Tricks And Get More Impact On Google. In this tutorial we will let you know that How You can speed up your WordPress Site with .htaccess tricks. You can do anythin you want with .htaccess files. Generally it is hidden in the directory but do not worry we will let you to find it easily. With .htaccess you can also create redirects and much more. Why do not you take advantage of this file. This can make your website superfast. Just follow some of our easy and simple steps and get this awesome tutorial.

Speed Up WordPress Site

What .htaccess File Is ?

This is specially configured file which makes your site to random works.With .htaccess files you can create redirects, rewrite URLs on your website, create password protected directories and other technical things. You can also get good loading speed with this file.

Steps To Get .htaccess File On Your Server :

  • Go to your Web Hosting and Open File Manager.
  • Now open Public_html folder.

htaccess 1

  • Then click on Settings.

htaccess 2

  • Now click on Show Hidden File And Folders.

htaccess 3

  • Now you will see that .htaccess file is there.

htaccess 4

  • Right click on it and select Edit.
  • Add the codes given below.

GZIP Compression :

It reduces the amount of data that the server sends to your visitors. It can benefit your loading time by 50%-70%.  So add this code in the .htaccess file.


<ifModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript

Set Expires And Cache Control Headers :

When any user comes to your website first time them CSS files and other things are downloaded but with this trick when the visitors come’s next time the previous files are stored and which makes your website load more faster. Add this code to the .htaccess file.

# BEGIN Expire headers
<ifModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 5 seconds"
    ExpiresByType image/x-icon "access plus 2592000 seconds"
    ExpiresByType image/jpeg "access plus 2592000 seconds"
    ExpiresByType image/png "access plus 2592000 seconds"
    ExpiresByType image/gif "access plus 2592000 seconds"
    ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
    ExpiresByType text/css "access plus 604800 seconds"
    ExpiresByType text/javascript "access plus 216000 seconds"
    ExpiresByType application/javascript "access plus 216000 seconds"
    ExpiresByType application/x-javascript "access plus 216000 seconds"
    ExpiresByType text/html "access plus 600 seconds"
    ExpiresByType application/xhtml+xml "access plus 600 seconds"
# END Expire headers

Browser Cache Control :

This is related to the cache expiry date. It can be merged, replaces or removed. So add this code.
# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
    <filesMatch ".(ico|jpe?g|png|gif|swf)$">
        Header set Cache-Control "public"
    <filesMatch ".(css)$">
        Header set Cache-Control "public"
    <filesMatch ".(js)$">
        Header set Cache-Control "private"
    <filesMatch ".(x?html?|php)$">
        Header set Cache-Control "private, must-revalidate"
# END Cache-Control Headers

Final Words :

If you use this trick then this will surely make your site load time better that ever. Comment if you face any problem. Have fun with this trick.

Leave a Reply

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