I’ve dont it with .htaccess URL rewriting thanks to this nice tutorial: http://www.smashingmagazine.com/2011/11/introduction-to-url-rewriting/
So now when a user clicks a thumbnail, I link them to www.mydomain.com/blog/001/my-first-post. That’s the link they’ll see in the address bar, but actually the content of the page www.mydomain.com/blogpost.php?id=001 will be loaded. Neat!
This is my .htaccess code
RewriteEngine On
RewriteRule ^blog/(.+)/(.+)$ blogpost.php?id=$1 [L]