S
S
Stanislav Tamat2015-01-18 12:38:20
Apache HTTP Server
Stanislav Tamat, 2015-01-18 12:38:20

How to rewrite the url when submitting a form using the GET method?

There may be another way to change the query string, but it's not obvious to me. It is necessary to redirect to the
request when requesting . The following rules cause a circular redirect.
/?q=поисковой%20запрос
/search/поисковой%20запрос

RewriteCond %{QUERY_STRING} ^q=(.*)$ [NC]
RewriteRule ^/* /search/%1? [NC,L,R=301]

RewriteRule ^search/(.*)$ index.php?q=$1 [L,QSA]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ShamblerR, 2015-02-25
@ShamblerR

RewriteCond %{QUERY_STRING} (^|&)q=поисковой%20запрос($|&)
RewriteRule ^domen\.ru/$ /domen.ru/search/поисковой%20запрос? [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question