Custom Error Page When Entering Nonexistent Url

#1
Good day!

I have a custom error page:

In mod_rewrite:

/404/

In absolute path:

/path/to/404.php

When I tried to enter something like this:

https://www.domain.com/some-unknown-thing/

The custom error page works, but when I tried this:

https://www.domain.com/unknown-file.php

It will be redirected to the default error page of litespeed.

Here is the code I am using in .htaccess:

ErrorDocument 404 /404/

What is the reason? I want all errors to redirect to my custom error page, thank you.
 

NiteWave

Administrator
#4
regarding absolute path, can you further confirm, it's relative to document root or absolute path on file system.

for example, in .htaccess
ErrorDocument 404 /my-path-to/404.php
it should be relative path to document root, its absolute path in file system maybe /home/user/public_html/my-path-to/404.php

I need more detail(code snippet) about your .htaccess so that I can see if can reproduce on our lab.
 
#7
When entering a nonexistent url

This code not works:

ErrorDocument 404 /404/

While this code works

ErrorDocument 404 /my-path-to/404.php

Note: I already rewrited the /my-path-to/404.php into /404/ before I use it in ErrorDocument
 
Top