Hack: Create a Simple 404 Log

When someone links to your site with the wrong URL, or, worse, you link to your own site with the wrong URL, it would be nice to know. You could check your server’s logs for 404 errors to see what bad URLs people are using. But I find it easier to create a simple 404 log file that I can access without much hassle. Then I check it every once in a while to see if I need to add a redirect to the correct page so I don’t miss some traffic.

Continue reading “Hack: Create a Simple 404 Log”

Hack: Redirect Posts To Any URL

Suppose you have an old post that you want to remove, but you know there are still links to it out there. Ideally you want to redirect anyone coming to that page to another page on your site, or maybe even to another site. You can do that with a few lines of code, and in such a way that you can customize the destination URL on a post-by-post basis without touching the code again. So no need for a plugin or messing with your .htaccess file.

Continue reading “Hack: Redirect Posts To Any URL”