Help with Friendly Url with parameter

1

I am looking for help with friendly url for the moment I can access the URLs in this way

www.mydomain.com/demo-1
www.mydomain.com/demo-8
www.mydomain.com/demo-14

This is my code:

RewriteRule ^demo-([0-9]+)/?$ ver.php?id=$1 [L,NC,QSA]

I am looking to replace the word "demo" in the url with my friendly url, in this case "man-shoes, purses-demujer, poles, etc." where the last number is the variable:

I'm looking for this

www.midominio.com/zapatos-de-hombre-color-verde-talla-42-1
www.midominio.com/polo-manga-larga-talla-35-8
www.midominio.com/zapatillas-de-mujer-talla-20-14

    
asked by Yii 16.04.2017 в 00:48
source

1 answer

1

An option if you want to interpret any string instead of "demo", use (.*) instead of demo . Also, you would have to change the parameter from $1 to $2 .

This is how it should work:

RewriteRule ^(.*)-([0-9]+)/?$ ver.php?id=$2 [L,NC,QSA]
    
answered by 16.04.2017 / 05:43
source