Using .htaccess to set a custom 404 page
Aug, 31, 2008
Posted byThis should be a decent, if short, follow-up for the recent post about using PHP for redirects. If you want to build a custom 404 page to avoid visitors seeing whatever 404 page their browser presents then try this in your .htaccess file:
ErrorDocument 404 /notfound.html
Or maybe you don’t want to actually build a custom 40, but you still don’t want visitors to see their browser’s default 404 message, then just send them to your home page:
ErrorDocument 404 /index.html (or whatever your home page is named)
Just don’t forget to update this entry if you ever change your home page name!
RELATED POSTS
- » CSS: Use ID Selector or Classes?
- » Expanding Dreamweaver usability with Windows/Mac OS/Linux
- » PHP Redirect - flexible and even scripted redirection
- » Dreamweaver 8 'Bug': This search result cannot be displayed because
- » Dreamweaver: Find Replace in Open Documents
Posted in Web Design by |