Custom ERROR pages not working as expected

Website URL grahovski.cloudns.be

I have strange question I’ve enabled custom 401 page for my wordpress but when I test it it’s just saying the standard text for Unauthorized

I expected to see this page when is not authorized


which the URL is https://www.grahovski.cloudns.be/Unauthorized.html
Is it wrong something from my end or it’s just something else?

You can test it at https://www.grahovski.cloudns.be/wp-admin

This is what I have in .htacess :
ErrorDocument 401 https://www.grahovski.cloudns.be/Unauthorized.html

change to this
ErrorDocument 401 /Unauthorized.html

4 Likes

This is kinda strange because when I try from the dashboard Im getting this

I tried it this way, it worked

1 Like

Yes you do need the / which specifies the root (htdocs) of your hosting where you have your Unauthorized.html file which is exactly what I posted :+1:

If your custom page was in some sub-directory of htdocs then you would also need to add that to the path like this for example
/my-custom-error-directory/Unauthorized.html

6 Likes

Please also note the help text below the Action field.

If a file path is given (starting with a slash), the provided file is returned.

Emphasis added to the important part.

If you just enter Unauthorized.html, it could mean that you want to load the file Unauthorized.html, or want to redirect to a website http://Unauthorized.html. The latter is probably not a real website, but the form is not sophisticated enough to try and guess what you mean.

6 Likes

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