Answer the question
In order to leave comments, you need to log in
Setting up htaccess 404 error. How to do it right?
There is something like this in the url: site.ru/news.php?id=1
And I want it to be site.ru/news/1
I wrote the following
RewriteRule ^news/([^/]+)/?$ news .php?id=$1
Everything works, but when you go to the site.ru/news.php link, it goes to site.ru/news and a 404 error is issued
How to register another redirect from site.ru/news.php?id=1 to site .ru/news/1
and from site.ru/news.php to site.ru/news
Answer the question
In order to leave comments, you need to log in
# 301 --- http://www.mydefile.ru/company/?a=47071 => http://www.mydefile.ru/about/
RewriteCond %{QUERY_STRING} (^|&)a=47071($|&)
RewriteRule ^company/$ /about/? [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question