This is how I have optimized my .htaccess for to Improve WordPress Speed and Security
Lets start with the CODE in the .htaccess file, yours will always be in the root folder of your WordPress installation.
Click here, if you want to do it for WordPress 3.6
1) Line 1 to 68 is all thx to 5G BLACKLIST/FIREWALL by Jeff Starr
2) Line 70 to 74 is all Server Security Tweaks thx to Josiah Cole
3) Line 78 to 83 These are only there for testing by me, Mark de Scande. PS These settings below can be used in your php.ini
#php_value max_execution_time 800 # I Use 140
#php_value max_input_time 800 # I Use 150
#php_value memory_limit 512M # I Use 96M
#php_value upload_max_filesize 30M # I Use 16M
#php_value post_max_size 30M # I Use 16M
How do I add a custom php.ini file to my host ?
Option 1: .htaccess – Just add the details to it and test your site if your site don’t load, then remove the details.
Option 2: Use Note Pad ++ Make a new file add the content’s Ie php_value max_execution_time 800 etc
Then save it is php.ini. Now upload the file to the /root of your WordPress installation ,the same place were you had the .htaccess file.
Now pull up your site, if it loads your good to go, if not delete the file.
5) Line 88 to 102 Now here you would first have to have a look at your php settings on your site. Make a file and call it happy.php then add the contents of How To Get PHP Settings.
6) Line 104 to 134 That’s all to do with images and helps a lot with your GT Metrix score
7) Line 139 to 153 That’s all to do with Security go Test your site at Sucuri Security — Protect Your Interwebs! I love these guys.
8) Line 155 to 158 don’t Just copy and paste. You have to make your own it is easy. I will show you how.
- ErrorDocument 404 /404.shtml
- ErrorDocument 403 /403.shtml
- ErrorDocument 500 /500.shtml
Log in to cPanel, go to the bottom of the page look for Error pages, now go and edit the pages you need.
9) Line 160 To 182 That is for WordPress MU
Now After Tweaking .htaccess
Page load time: 2.35s
Total page size: 618KB
Total number of requests: 85
Start Load 0.413s
Full Load 6.415s
Yes They are all green
Load time 1.96s
Perf. Grade 80/100
The good news is, when it comes to tweaking…My site, BlogLines.co.za rocks.
You can Hire me through oDesk to Tweak your WordPress 3.5 Site.