Protect WordPress with .htaccess | WordPress Optimization

WordPress is world’s most popular CMS, but with this growth, It also have some bad points. WordPress can be hacked easily, To get more security we can use some htaccess rules.

.htaccess is very common and most essential file. You can do lots of things by using .htaccess file.

Enable Browser Caching:

Browser caching allows users to speed up the loading time of websites by serve cached copy of design elements such as CSS stylesheets and media items such as images from users computer rather then website server.

To enabling browsing caching, you need to add this code to your .htaccess file:

GZIP Compression:

When visit webpage, request send to web server, if the server has gzip enable it receive gzip file which is significantly smaller and if it’s not enable it receive the page which is uncompressed version which may be bigger in size.

Gzip locates similar strings within a text file and replaces those strings temporarily to make the overall file size smaller. By gzip compressor reduce the size of page and style sheet by up to 70%

If your hosting provider has mod_gzip module enabled, the best way to compress your content is to add the following lines to your .htaccess file:

Enable gzip compression on Apache web-servers:

Enable compression on NGINX web-servers:

Keep Alive:

Display webpages in browser must request a file from web server, if file exists on web server browser gets the file and read the file. Then browser request other things like HTML, style sheets, JavaScript and images. If a new connection has to be open for every request or file it could take significantly longer time.

Keep alive also known as persistant connection that says “At a time you can get more more than just a single file”

Enable keep-alive in Apache:

Leverage browser caching:

Every time browser load web page it has to download all the web files like HTML, CSS, JavaScript, logo and images to properly display the page. Browser caching can help by storing some of these files locally in the user’s browser.

Browser caching is important is because it reduces the load on your web server, which ultimately reduces the load time of website.

Protecting wp-config.php:

Disable File Editing:

Protect WP-Includes:

If you are having problems implementing the above suggestion or beefing up the security, optimization of your WordPress installation, drop us an email. and we will gladly assist you.

.htaccees for Magento Performance Optimization

Magento is one of the most widely used eCommerce platforms today that people to choose to grown their online business. Optimizing the speed of your Magento allows customers to have the best user experience while shopping in your e-commerce store. In this post, you will get some tips to increase Magento speed and Magento performance optimization techniques.

Every e-commerce shop owner and users love the faster website. If website speed is slow user may leave a website and buy products from your competitors.
So you want to speed up your Magento store, here are some htaccess file tips:

Browser Caching & htaccess Configuration

Enable Output Compression
The apache mod_deflate module, which compresses text, CSS, and javascript before it is sent to the browser. This result lower file size.

Gzip Compression
This will compress stylesheet and web page before sending them to browser

Enable Expires Headers
To determine how long web page components cached in a browser cache. Web page static components like images, stylesheets.

Disable ETags
Entity tags (ETags) are a mechanism that web servers and browsers use to determine whether the component in the browser’s cache matches the one on the origin server. ETags were added to provide a mechanism for validating entities that are more flexible than the last-modified date.

Mime Type Caching

 

Magento load JavaScript(JS) and CSS files in footer: http://blog.rahuldadhich.com/magento-load-css-js-footer/

Thanks.

  • Rahul Dadhich