htacces rewrite url

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mezned
Forum Newbie
Posts: 1
Joined: Mon Jun 02, 2014 11:05 am

htacces rewrite url

Post by mezned »

hi

i have url like ' http://mysite.com/article.php?id=9

in my site i want to display url like ' http://mysite.com/product-nameproduct-id.html

please help me.

thank you
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: htacces rewrite url

Post by Celauran »

Something like this, maybe?

Code: Select all

RewriteRule ^product-([\w]+)-([\d]+).html article.php?id=$2
Post Reply