Development Blog by Professionals
friendly url with htaccess
suppose you want /articles.php?cat=$1&art=$2 to become magazine/1/2
then you need these two rules:
#articles.php?cat=$1&art=$2
RewriteRule ^magazine/([^/]*)/([^/]*)$ /articles.php?cat=$1&art=$2&marker [L]
RewriteCond %{REQUEST_URI} /articles\.php [NC]
RewriteCond %{QUERY_STRING} ^cat=(.*)&art=(.*)
RewriteCond %{QUERY_STRING} !marker
RewriteRule (.*) http://mydomain/%1/%2? [R=301,L]
| Print article | This entry was posted by kostas on March 4, 2010 at 11:58, and is filed under .htaccess. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |


