Lately I’ve been trying to make all my links to look so pretty that even art critics could say something nice about them, and to make it easier for visitors to remember my links. And believe me, it is actually easier than it seems.

How? Well, the solution to this problem was the use of mod_rewrite.

I am not going to explain to you what it is in depth, but basically, it rewrites URI’s and also makes it easier for search engines to find your pages. A little tutorial follows.

Instead of using long useless links like:

You can make it look so much better with mod_rewrite, like this:

Just by adding these lines in a .htaccess file:

RewriteEngine On
RewriteRule ([0-9]+)/([0-9]+)/(.*)$ showpost.php?year=$1&month=$2&slug=$3
Options +FollowSymlinks
RewriteCond %{http_host} ^www\.phun-ky\.net [nc]
RewriteRule ^(.*)$$1 [r=301,nc,L]

If this was hard or you want to learn more, check out the cheat sheet posted with this post or read this .htaccess tips and tricks.