ErrorDocument (.htaccess)

kuyenmotdivad

Well-known member
Hi,

How come if I add this to my .htaccess it still gives thisusing XF : if I type something that does not exist like a file or folder - http://mysite.com/hjhjh (A controller for the route path hjhjh was not found.) and it does not goto my error 404 document instead?

PHP:
  ErrorDocument 400 /errors/400.php
  ErrorDocument 401 /errors/401.php
  ErrorDocument 403 /errors/403.php
  ErrorDocument 404 /errors/404.php
  ErrorDocument 500 /errors/500.php
But if I add the bit in .htaccess that was included with XF below

PHP:
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default
I still get the same error (A controller for the route path hjhjh was not found.)
 

Mike

XenForo developer
Staff member
Every file in XenForo is found because the rewrite rule matches everything, unless it's in certain directories.
 

Mike

XenForo developer
Staff member
Unless you remove the .htaccess completely (and don't use full friendly URLs) or the 404 happens within a specific directory (eg, styles), yes.
 
Top