Ten points to improve WordPress security

by fzcs on 2010-07-03 21:52:56

Security is an eternal topic, especially on the Internet, and this article will introduce you to 10 tips to improve the security of your WordPress blog. The first five were introduced yesterday, and the last five are continued today.

6. Prevent photo theft.

Most web hosts and VPS are traffic limiting, and images tend to consume the vast majority of traffic. We hope that our articles will be visited and spread by more people, but at the same time we have to face the huge traffic brought by picture links. So it is absolutely essential to prevent images from being linked outside.

Solution: Modify the.htaccess file to add the following code, before you must remember to back up.

RewriteEngine On

#Replace ? mysite\.com/ with your blog url

RewriteCond %{HTTP_REFERER} ! ^http://(.+\.) ? mysite\.com/ [NC]

RewriteCond %{HTTP_REFERER} ! ^ $

#Replace /images/nohotlink.jpg with your quot; don't hotlink" image url

RewriteRule .*\.(jpe? g|gif|bmp|png)$ /images/nohotlink.jpg [L]

Only your website will be able to reference the image, and all external references will be replaced with nohotlink.jpg files. You can display copyright information in nohotlink.jpg. You can also specify a file that does not exist.