A
A
Andrey Andrianov2019-03-27 20:48:50
htaccess
Andrey Andrianov, 2019-03-27 20:48:50

How to translate template /123/8888/ into index.php?id=1233&num=8888?

Greetings, Omniscient ALL!
I would like to translate site.ru/123/8888/ into index.php?id=1233&num=8888
I try something like this
RewriteRule ^([0-9-]+) index.php?id=$1 [L,QSA]
RewriteRule ^( [0-9-]+)\/([0-9-]+)/?$ index.php?id=$1&city=$2 [L,QSA]
get only index.php?id=123

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-03-27
@itld

RewriteRule ^([0-9]+)$ index.php?id=$1 [L,QSA]
RewriteRule ^([0-9]+)/([0-9]+)/?$ index.php?id=$1&city=$2 [L,QSA]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question