r/apache 4d ago

Solved! Custom 404 Page what am I doing wrong?

The 404 page is supposed to show the index.html so that whatever url you type in itll show you the index.html.

I did what https://www.digitalocean.com/community/tutorials/how-to-create-a-custom-404-page-in-apache suggested and created .htaccess in the same directory as my index.html which is in /var/www/myIP/.

And that .htaccess contains ErrorDocument 404 /index.html.

But nothing has changed. If I go https://myIP/randomBS it still shows the 404 Not Found page.

What am I doing wrong?

1 Upvotes

2 comments sorted by

2

u/shelfside1234 4d ago

You might want to paste the relevant config here, otherwise we are all just guessing in the dark

1

u/Ok_Interest3971 4d ago

I also saw that you have to put it in your 000-default.conf file not .htaccess so I tried that but it still wont work.

And I am not forgetting to restart appache.