[HTACCESS] ErrorDocument not redirecting
#1
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
[Image: logo.png]
Xyaena's Forums Webmaster
Reply
#2
Do you have a 404.html file in your DocumentRoot for the virtualhost of your forum ?
Do not ask me help through PM or Discord
Reply
#3
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.
[Image: logo.png]
Xyaena's Forums Webmaster
Reply
#4
(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
Reply
#5
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.
[Image: logo.png]
Xyaena's Forums Webmaster
Reply
#6
(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
Reply
#7
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.
[Image: logo.png]
Xyaena's Forums Webmaster
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)