Answer the question
In order to leave comments, you need to log in
Redirect 301 and question mark in URL
You need to redirect a number of pages to new addresses. The problem is that the pages contain a question mark and therefore the redirect via the htazzes of the form does not work:
Redirect 301 /?module=View&category=ololo site.ru/new
And the character / question mark is not escaped. Can you tell me how to make a redirect in this case? Only a monster crutch in php came to mind, which will issue on all pages of the site:
IF you are on a page like this, THEN header("HTTP/1.1 301 Moved Permanently");
Is there any correct and "clean" solution to the issue with the question mark in the URL and the redirect?
Answer the question
In order to leave comments, you need to log in
For example like this
RewriteCond %{QUERY_STRING} ^foo=bar&bar=baz$
RewriteRule ^(.*)$ http://www.example.com [R=301,L]
if ($query_string ~ "^?module=View&category=ololo")
{
rewrite ^(.*)$ http://site.ru/new redirect;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question