Website shows 000webhost 500 pages instead of 404 pages


#1

If you goto an unknown page on my website Eg, https://saxobroko.ga/rfoygsb it shows a 500 page instead of 404 even though i have setup my .htaccess file correctly

Htaccess File

ErrorDocument 400 /errorpages/400.html
ErrorDocument 401 /errorpages/401.html
ErrorDocument 403 /errorpages/403.html
ErrorDocument 404 /errorpages/404.html
ErrorDocument 500 /errorpages/500.html

DirectoryIndex index.html
Options +FollowSymLinks -MultiViews

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)$ $1.html [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.)$ /languages/$1 [L]
RewriteCond %{HTTP_HOST} ^saxo-broko.000webhostapp.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.saxo-broko.000webhostapp.com [NC]
RewriteRule ^(.
)$ https://saxobroko.ga/$1 [L,R=301,NC]
RewriteCond %{HTTP_HOST} ^www.saxobroko.ga [NC]
RewriteRule ^(.*)$ https://saxobroko.ga/$1 [L,R=301,NC]

Redirect 301 /newindex /index
Redirect 301 /newindex.html /index


#2

And if you replace

ErrorDocument 500 /errorpages/500.html

With

ErrorDocument 500 /errorpages/404.html

What happens?


#3

still shows the default 500 error instead of 404


#4

Have you tried removing the rest of the contents in .htaccess and trying again?


#5

uh no…? Its only the 404 pages and 500 pages nothing else the other error pages work and so does the rest of my website its just 404 pages turn into 500 pages and the 500 pages aren’t what they’re supposed to be.

Examples
What it shows


What its supposed to show


#6

hmm. very odd. mind if I take a look at your site files?


#7

yes you can

mmmmmmmmmmmmmmmmmmmmmmm


#8

Are you using Zyro or WordPress, or is this custom built?


#9

custom built


#10

Did you once use Zyro? I see some Zyro files in the file manager.


#11

It works fine when you have a .htaccess with only


RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /languages/$1 [L]
RewriteCond %{HTTP_HOST} ^saxo-broko.000webhostapp\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.saxobroko\.ga [NC]
RewriteRule ^(.*)$ https://saxobroko.ga/$1 [L,R=301,NC]

Is now removed and it works, weird?


#12

yea but if i remove that stuff than https://saxo-broko.000webhostapp.com wont redirect to https://saxobroko.ga and neither will www.saxobroko.ga also all my html pages will show .html on the end of them :confused:
also @hexa i did once use Zyro


#13

ah, ok. I thought maybe that would have caused the issue, but I guess that isn’t the case here. There has to be something wrong with the .htaccess code that is causing this issue. Try adding back 1 line each time and see which line breaks the site. :slight_smile:


#18

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /languages/$1 [L]

well it turns out my url rewrite for my languages folder was causing the issue


#19

is your issue solved??


#20

not completely but overall yes