Greetings, I am creating a dynamic web page in which certain information is loaded using a variable $_GET
. and the url
remain of the type
https://www.dominio.com/deals/deals.php?deal_id=483
where the variable deal_id
is the ID of my product and with this I show the info on the page making a query mysql
, such as the name, price, etc and all good in this part.
The thing is that I read that using the file htaccess
I can change the url
to make it more search engine friendly for an SEO theme and place it as:
https://www.dominio.com/deals/nombre-articulo
The issue is that I have tried several regular expressions and I do not achieve the desired results because the url
shows no changes and it keeps showing the same even after including the regular expression in the htaccess
and it is probably because it is not implement the changes, could you help me? , I used this expression
RewriteRule ^deals/(\w+)$ deals.php?deal_id=$1
but I really do not know how to implement it, and especially if I can include the name of the product in URL
in addition to the product ID , something like concatenating the name of the product to URL
.
I thought about going through the parameter of the product name, even if I did not use it type:
https://www.dominio.com/deals/deals.php?deal_id=483&nombre=nombre-producto/
but now how would be the regular expression to mask this URL
?