A
A
AlexLol962018-10-10 20:44:29
htaccess
AlexLol96, 2018-10-10 20:44:29

How to keep current URL at 404 page without breaking redirect rules?

There is a site, in .htaccess there is a rule for redirects from urls without "/" to url with "/" at the end (test.ru/catalog -> test.ru/catalog/) This rule also applies to 404 pages, that is, test .ru/dsadadasda is first redirected to test.ru/dsadadasda/ , then a 404 error page is displayed. How to show a 404 error page immediately, without a redirect, but at the same time not violate the rules for other urls?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2018-10-10
@xmoonlight

It is necessary to remove the redirect for missing pages.
Namely: transfer the fix rule from .htaccess to the URI-router script and fix the url with a closing slash there and don't execute at 404.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question