E
E
Egor Traurov2014-07-09 18:10:31
PHP
Egor Traurov, 2014-07-09 18:10:31

How to remove question mark using mod_rewrite?

Hello, tell me, please, the code :)
You need such a transformation of the link:
from - site.ru/?id123
to - site.ru/id123
I read about rewrite. But I don't seem to understand :D Give me a hint, at least please :)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Krasnov, 2014-07-09
@ProMaks

Like this:

RewriteCond %{QUERY_STRING} ^(id123)$
RewriteRule ^ /%1? [L,R=301]

O
Optimus, 2014-07-09
Pyan @marrk2

#RewriteEngine on
#RewriteRule ^menu/([^/\.]+)/?$ menu.php?id=$1 [L]
#RewriteRule ^art/([^/\.]+)/?$ art.php ?id=$1[L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question