T
T
TopGun892017-08-01 13:20:56
MODX
TopGun89, 2017-08-01 13:20:56

How to make a 301 redirect to .htaccess from non-existent pages?

Hello!
Tell me how to make a .htaccess 301 redirect from ANY non-existent page to the main one?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladislav Lyskov, 2019-03-05
@FlapJalc

the base does not let you in, says - you are not your own

A
Alexander Shinkar, 2019-03-05
@Accusser

Check the configuration file to see if the connection to the database is correct.

A
Alexander Shapoval, 2017-08-01
@TopGun89

# переопределяем страницы ошибок
ErrorDocument 400 /error.php?err=400
ErrorDocument 401 /error.php?err=401
ErrorDocument 402 /error.php?err=402
ErrorDocument 403 /error.php?err=403
ErrorDocument 404 /error.php?err=404
ErrorDocument 500 /error.php?err=500
ErrorDocument 502 /error.php?err=502

I threw off the entire error code to put a redirect to the main page instead of /error.php?err=502 put only a slash, and if you need only from non-existent pages, then leave only the 404 error
ErrorDocument 404 /

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question