MyBB Community Forums

Full Version: [HTACCESS] ErrorDocument not redirecting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Having a problem with getting htaccess for 404 to redirect as the following code:

ErrorDocument 404 404.html
It instead directs me to this error:
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

What's going on with my htaccess file?
MyBB Version 1.8.19
MySQLi Version 10.2.19
PHP Version 5.6.38 - Build date Sep 21 2018 11:46:49
Do you have a 404.html file in your DocumentRoot for the virtualhost of your forum ?
I don't seem to have a "DocumentRoot" folder. I'm a noob to Apache, so I don't exactly know what to do. Outside sources including Apache programming fails to inform me how it should work.
(2018-11-15, 01:09 AM)Xyaena Wrote: [ -> ]I don't seem to have a "DocumentRoot" folder.

Yes, you do. Because your website loads.

CPanel calls this www_data (or public, which is an alias). Everything is then /{folder}/{subfolder}/{file}

Ergo, you should be using a full path. /404.html.

ErrorDocument 404 /404.html
That's still a negative.

htaccess.txt in the forum folder does not tell that it exists. I have a www folder but that directs to the main site. What I have here is a subdomain, running MyBB htaccess.txt.
(2018-11-15, 04:44 AM)Xyaena Wrote: [ -> ]That's still a negative.

htaccess.txt in the forum folder does not tell that it exists. I have a www folder but that directs to the main site. What I have here is a subdomain, running MyBB htaccess.txt.

Oh sorry, public_html. www is the alias. It’s been a very long time since I’ve used CPanel.

Rename htaccess.txt to .htaccess
I'll attempt that when I get home.

(2018-11-15, 06:21 AM)Ben Cousins Wrote: [ -> ]
(2018-11-15, 04:44 AM)Xyaena Wrote: [ -> ]That's still a negative.

htaccess.txt in the forum folder does not tell that it exists. I have a www folder but that directs to the main site. What I have here is a subdomain, running MyBB htaccess.txt.

Oh sorry, public_html. www is the alias. It’s been a very long time since I’ve used CPanel.

Rename htaccess.txt to .htaccess

That worked successfully. Thank you.