S
S
Stanislav Nekrasov2020-01-02 18:53:27
htaccess
Stanislav Nekrasov, 2020-01-02 18:53:27

How to rewrite from /u/id to /user.php?id=id with other parameters?

Hello. Happy New Year 2020.
Yes, I know, the question is not particularly new, but somehow I did not find a solution.
I need the user to go to the address
/u/id, where id is a number
, and the content of the page is shown to him
/user.php?id=id
. I did it with this line:
RewriteRule ^u/(\d+)$ user.php?id=$1 [L]
But the other get parameters are not passed, i. it is necessary to
/u/1?a=bshow the page /user.php?id=1&a=b
How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-01-02
@Metalofon

QSA flag
RewriteRule ^u/(\d+)$ user.php?id=$1 [L,QSA]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question