0

Hey there,
i'm beginner programmer in PHP and try on my web add cool url.
I've this simple rewrite rule that make from url page.com/index.php?id=about this url page.com/about

RewriteEngine on
RewriteRule ^(adm|img|content)/(.*)$ $1/$2 [L]
RewriteRule ^(.*)$    index.php?id=$1 [L,QSA]

But now i wanna to try some harder, e.g. i've this url address:
page.com/index.php?id=produkty&idk=sport&idv=football&idp=donovan
And I'm trying in url address to get: page.com/sport/football/donovan
(or similarly e.g. page.com/index.php?id=produkty&idk=sport -> page.com/sport)

I'm edited rewrite rules follows:

RewriteEngine on
RewriteRule ^(adm|img|content)/(.*)$ $1/$2 [L]
RewriteRule ^(.*)$    index.php?id=$1 [L,QSA]
RewriteRule ^(.*)$    index.php?id=$1&idk=$2&idv=$3&idp=$4 [L,QSA]

But i got wrong result :/ The rule isn't works..

I readed a lot tutorials on this problems, but this example i can't to get.
If is here some great person, which help me with this code, i will to be very glad, Thanks.

Manny

4
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by storm123
0
RewriteRule ^index\.php?id=(.*?)&idk=(.*?)&idv=(.*?)&idp=(.*?)$ $2/$3/$4 [L]

This one should work, given all the parameters are there, in that order. Hope this will get you started.

0

There is a problem with rewrite rules . Then there is one syntax can be used to solve that problem there are lots of parameters can be used for the these rules . For these you have to read the tutorials regarding these rules .

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.