Basic HTML installation error_page 404 not working


#1

I just completed a basic HTML installation for www.howtocleanthings.com, but the 404 page doesn’t seem to be working. Whenever I type in some nonsense url like (www.howtocleanthings.com/kjdhakjhad), the page returned is the homepage, not a 404 error.

How do I fix this? I added this line to my server block: error_page 404 /404.html; and it still doesn’t work.


#2

Its seems like you are created html site http://www.howtocleanthings.com/

You need to create index.html in http://www.howtocleanthings.com/ webroot

  
echo "Its Works" >> /var/www/howtocleanthings.com/htdocs/index.html  

#3

Yeah, that already happened. It’s a --html site that I installed a long time ago. The index.html is there in the root folder, but it’s impossible to get a 404 error to show up, even on a fresh install at this server: 23.253.230.114


#4

I figured it out. In order to get a 404 to return, I had to comment out this line in the available-sites file:

location / {  
		# try_files $uri $uri/ /index.html;  
	}

#5

Hi @samoya22,

Glad to know your issue is resolved. I am closing this support ticket for now.

Feel free to create a new support ticket if you have any queries further. :slight_smile:


#6