Irish WordPress training, editing .htaccess file

The .htaccess file is one of the most important files on your website. If its not there create one.

First off protect your wp-config.php with code in your .htaccess file.

The first thing you want to do with wp-config.php is protect it. A way to secure the file using .htaccess:

<Files wp-config.php>
	Order Allow,Deny
	Deny from all
</Files>

Copy and paste the code it should then be placed in an .htaccess file located in the directory that contains your wp-config.php file.

After saving the .htaccess file and refreshing your website. Enable Compression its a great bandwidth and speed saver.

 SEO Hints



# BEGIN GZIP COMPRESSION

mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*

# END GZIP COMPRESSION

Paste your url into the following to check to see if your compression is working using the Gzip compression tester tool.

 

Setup browser caching with wordpress websites


# Setup browser caching

ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"