Answer the question
In order to leave comments, you need to log in
How to get rid of signs? in url?
Good day!
Tell me, please, in such a situation:
if you enter in the url, for example
, mysite.ru/catalog ? /something
then fulfills the catalog route - the page is displayed. Dubbing, however.
How to redirect from catalog?/something to just catalog/something, i.e. get rid of the question marks?
tried like this: RewriteRule ^(.+)\?(.+)$ /$1$2 [R=301,L]
it doesn't work
Answer the question
In order to leave comments, you need to log in
Everything after ?
that is GET parameters. In turn, Get is not part of the url and does not fall into %{REQUEST_URI}
# 301 --- http://www.test.com/faq.html?faq=13&layout=bob => http://www.test2.com/faqs.html
RewriteCond %{HTTP_HOST} ^www\.test\.com$
RewriteCond %{QUERY_STRING} (^|&)faq\=13($|&)
RewriteCond %{QUERY_STRING} (^|&)layout\=bob($|&)
RewriteRule ^faq\.html$ http://www.test2.com/faqs.html? [L,R=301]
# 301 --- http://www.test3.com/faq.html?faq=13&layout=bob => bbq.html
RewriteCond %{QUERY_STRING} (^|&)faq\=13($|&)
RewriteCond %{QUERY_STRING} (^|&)layout\=bob($|&)
RewriteRule ^faq\.html$ /bbq.html? [L,R=301]
(^|&)layout\=bob($|&)
layout\=bob
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question