Whenever I upload a HTML file it returns a 404 error

Username: epiz_28467217
Error Message: 404 error

Whenever I upload a HTML file, and go to the web address, it returns a 404 error every time. I was having an error yesterday with it saying ‘Too many redirects’ but I fixed that now.

Can anyone help me?
Thanks

Can we have your URL and the page link where the error occurs?

1 Like

Sure. The url is mazer800.xyz, and the page where the error occurs is mazer800.xyz/youtube

I added something in my .htaccess file in htdocs which removes the .html from the URL, it’s worked with other URLs before.

Can you please send a screenshot of the /htdocs directory, as well as that .htaccess file?
Thanks!

Here’s the htdocs directory:

Here’s the .htaccess file. The rest of it is some Mozilla Observatory recommendations to get myself an A+ rating for my site. I believe lines 6 to 9 is the code to remove the .html from the URL:

Try temporary removing lines 5-9 in the .htaccess file (take a backup first), clear your cache (and Cloudflare cache if you use Cloudflare), than try and load https://mazer800.xyz/youtube.html and see if it works. If it does, one (or more) of those lines you removed us to blame.

Thanks.

2 Likes

Wow, it works
Must have been that code then.

Thanks for your help.

No problem,
Here is the code I use to remove the .html and .php extension. Feel free to copy it and see if it works.

RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.html [NC]
RewriteRule ^ %1 [R,L,NC]
1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.