Jump to content
Latest News: (loading..)
Sign in to follow this  
JcMagpie

A simple approach to a custom 404 error page for osCommerce

Recommended Posts

This is often overlooked when moving or updating a website. Most Hosts will provide a default 404 error page but these are generic and not very helpful to your customer.

No matter how hard you try you will always find the odd broken link or missing document. This is a basic and simple way to give your customer a better more useful page on this error.

It will give your customer a contact page to let you know what’s missing or how you can help.

This is based on shop being installed in root directory. and on Edge but should work for any version

First open your .htaccess file in the root directory and add this line to it.

“ErrorDocument 404 https://www.mywebsite.com/404contact_us.php”

****replace https://www.mywebsite.com with your own website****

Now make a copy of contact_us.php in the root directory and name it 404contact_us.php

Now open 404contact_us.php and find this line. It should be around line 37 in Edge.

 

<h1 class="h3"><?php echo HEADING_TITLE; ?></h1>

 

Replace this with,

 

<h1 class="h3"><?php echo "Sorry but we could not find that! Please contact us and we will try and help."; ?></h1>

 

Now save and close the 404contact_us.php file.

That’s it. Now when someone finds a broken link instead of getting a generic 404 error page like this.

image.png.73c45dc7b06b52f3568fc4b1e0d791ba.png

They are redirected to your website 404 contact _us page. Its only a little thing but it all helps.

image.thumb.png.71e7450ec5175b513431be5e41ece63c.png


 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×