Tag Archives: pretty urls

How Permalink Works

So you want to have something like /article/how_permalink_works/ instead of index.php?article=how_permalink_works, however keeping that you in your php you will have in $_GET['article'] the string "how_permalink_works". Well this is how you do it:

Put in your .htaccess:

RewriteEngine on
RewriteRule article/([0-9_a-zA-Z\-]+)/$ index.php?article=$1

Some more info on .htaccess: http://www.htaccess-guide.com/

Some more info on permalinks and other url stuff: http://net.tutsplus.com/tutorials/other/using-htaccess-files-for-pretty-urls/