Redirect to custom Page Not Found

Hi Is this the correct way to redirect to custom page not found.
I put this in the last part rule of htaccess

ErrorDocument 404 http://localhost/testfolder/custompagenotfound

Thank you in advance.

What happens when you tried it? :slight_smile: .

jemz,

The format is correct but localhost must have textfolder/custompagenotfound (no extension?) in its DocumentRoot. Typically, the redirection uses an INTERNAL absolute link rather than external as you have (the http://localhost … defines the external nature of the link).

Regards,

DK

Hi dklynn,

I remove the .php extension I did not post the rule in removing extension.

Thank you.

Sorry I was not able to understand, can you please show example. of internal absolute link.

Thank you in advance.

jemz,

Simply, instead of http://localhost/testfolder/custompagenotfound, /testfolder/custompagenotfound.

Again, though, use the file extension, and, most importantly, YOU remove the file extension (or link to the new extension) and let mod_rewrite make the redirection to the .php version.

Regards,

DK

Thank you

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