XF 1.5 How can I use a custom 404 page?


Active member
I was just wondering if I can use a custom 404 page.

I've added this to my htaccess file

ErrorDocument 404 /404.php

Within 404.php I check the request uri, for example like this

if (strstr($_SERVER['REQUEST_URI'], '/members/')){
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: " custom url );
In this example users should be redirected to a custom url if they try to view a member page that does not exist any more.

Unfortunately this does not work. I am still routed to a default XF 404 page.

Any ideas what I can do?


Well-known member
XF creates it's own error pages. You need an add-on to customize them. There are already some add-ons for it in the Resource-Manager here.