Answer the question
In order to leave comments, you need to log in
How to redirect from the wrong URL to the correct one?
Let me know if it is possible to make redirects.
Redirect 1.
For example, there are such existing URLs:
/category/category/page.html
/category/page.html
/page.html
/category/category/
/category/
/
/category/category/?
/category/?blablabla
/&
/category/category/?какой-то-несуществующий-get-параметр
/category/=
/<>{}[]и-другие-символы
/category/category/
/category/
/
Answer the question
In order to leave comments, you need to log in
You are asking for the impossible.
This is what your application should do. The web server simply does not have the necessary information to make such rules at its level, so there is no solution through .htaccess.
But no one will be able to write an example for you in php, either. this code will depend on your application - there is no universal external solution to your problem.
Those. theoretically, it can be made a proxy between the site and the web server, which will make additional requests, and check the responses to certain urls, but this will be the rarest crutch.
Well, kamon, type "redir" in the repository and see how many ready-made solutions there are
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question