Want to make http://domain.com/awesomepage.php?page=4&user_id=badass&action=go look like http://domain.com/awesome/page/4/user/baddass/go ?? To do this, you will need to use mod_rewrite in .htaccess or edit your Virtual Host in httpd.conf.
Here is the code:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^/awesome/page/([0-9]+)/user/(.+)/(.+)$ /awesomepage.php?page=$1&user_id=$2&action=$3 [NC]
Yes, you will need to create more than one entry per page, but if you plan it out correctly, you will need just one.
That’s all there is to it.
Done!!
Post a Comment