XF 1.5 How can I use a custom 404 page?

rhodes

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

Code:
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?
 
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.
 
Back
Top Bottom