1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Custom 404 page

Discussion in 'Styling and Customization Questions' started by Mr Lucky, Jun 25, 2015.

  1. Mr Lucky

    Mr Lucky Well-Known Member

    I have set .htaccess to show my own error 404:

    Code:
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 http://mysite.com/404.html
    ErrorDocument 500 default
    However it still just shows the default.

    Can anyone please help with how to do this?

    Thanks
     
  2. Adam K M

    Adam K M Active Member

    Mr. Goodie2Shoes likes this.
  3. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    Yep, all you got to do is copy everything from your 404.html and paste it in the template 'gfn404_error' and you are good to go :D
     
    Adam K M likes this.
  4. Mr Lucky

    Mr Lucky Well-Known Member

    Thanks for that, but I still wonder why it doesn't work via the .htaccess
     
  5. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    That would be because these lines
    Code:
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    
    tells Apache to parse the request to index.php if there's a chance of a 404 response.
     

Share This Page