M
M
mar4enkom2020-05-26 18:32:47
PHP
mar4enkom, 2020-05-26 18:32:47

How to issue a 404 page if the page does not exist in cnc?

If you go to a page on the site that does not exist, then Warning appears: call_user_func_array() expects parameter 1 to be a valid callback, class 'SiteController' does not have a method 'actionIndexasite'
in non-existent page, he got to the 404 page?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
galaxy, 2020-05-26
@galaxy

In general

header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");

E
Eugene, 2020-06-04
@Angel_D13

How do you select any page? Set the condition that if the selected page does not exist, then show the page such and such.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question