Wordpress optimization and htaccess

Status
Not open for further replies.

Adil

DevBest CEO
May 28, 2011
1,276
714
Due to this becoming more of a system administration/technical blog, I thought I'd tell you about some great plugins I myself use to optimize WordPress.
Askimet
Cloudflare
W3 Total Cache (W3TC)
WP -reCAPTCHA (WPRC)
Askiment and WPRC help protect your blog from those annoying spam bots that crawl, and Cloudflare and W3TC help optimize and supercharge your blog for speed. Look at my loading times, and you'll see .
You may also want to look into Cloudflare for your whole site, as it supercharges and protects it. However, if you're looking for more grass-roots based protection, utilize .htaccess. An example of some simple .htaccess code:
ErrorDocument 404 /notfound.html
You may be wondering what this does. ErrorDocument specifies that this code calls upon an error document, '404' is the error itself, and /notfound.html is the document where the 404 can be found.
If you have a certain directory you wouldn't like people to access, you could use the line:
deny from all
This basically denies access to the dir from ANY IP address.
This little piece of .htaccess can be useful:
Redirect /olddirectory
Where /old directory is the directory that you want to redirect to the /newdirectory. E.G:
Redirect /dump
Another nifty little trick is to stop those hotlinkers eating up your bandwidth. You can do this through:

RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^ [NC] RewriteRule \.(gif|jpg)$ [R,L]
This piece of code basically stops people hotlinking images, and replaces the image with another. Be sure to replace the mydomain.com with your domain, and the angryman.gif with your own image.
My last piece of code is:

IndexIgnore *
This, when placed in a directory .htaccess file, will stop ANY file from showing in the directory listing.
Obviously, you'll need to read on through google.
~Adil

(Need to update, will do when bothered =].)
 

Adil

DevBest CEO
May 28, 2011
1,276
714
Doesen't work but i've checked it before so nice.
It does work, I've implemented this into my blog.
Some proof of the caching:
HTML:
<!--
Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/ Minified using disk: basic Page Caching using disk: basic Database Caching 25/38 queries in 0.009 seconds using disk: basic Served from: jokercode.net @ 2011-09-22 17:43:03
-->
 
Status
Not open for further replies.

Users who are viewing this thread

Top