David G
David G

Reputation: 301

htaccess 404 redirect just showing page url

Can someone please help with my 404 redirect issue...

ErrorDocument 404 errorpgs/404.html

I've created a custom 404 page however when its called by a 404 error from my htaccess file, the only content shown on the page is the folder & file location of my custom html file.

Displays "errorpgs/404.html" and no other code or text, the address bar doesn't redirect and the title bar is just the browser default url bar.

The htaccess file is located in my website root folder and all other redirects are working fine.

Many thanks

Upvotes: 1

Views: 2114

Answers (1)

OlivierH
OlivierH

Reputation: 3890

Change

ErrorDocument 404 errorpgs/404.html

To

ErrorDocument 404 /errorpgs/404.html

Because apache takes this is as a message (ie string) to display, not a relative path to an html page. The slash indicates Apache this a path to a file.

Upvotes: 2

Related Questions