Jump to content

Unify all 404 errors (Products, Categories, CMS Pages, etc)


Recommended Posts

I have a problem and need some guidance to fix it. Currently we have a 404 page which is the following one:

5a4cc0c368ebe_Capturadepantalla2018-01-03alas12_25_39.thumb.png.d344da863a28b86bf3e5d6f806b93495.png

The thing is that when a product is not found that page shows correctly but when there is some other object not found other errors are shown. This happends with:

  • Categories
  • Manufacturers
  • CMS Pages
  • Suppliers
  • Etc

 

We are using Prestashop 1.6

Several examples:

5a4cc141c605c_Capturadepantalla2018-01-03alas12_22_55.thumb.png.f6a5f5442c9945071796902d15b67c20.png5a4cc140e3257_Capturadepantalla2018-01-03alas12_20_40.thumb.png.d6a8061d8b1f55999b4af4cfc60dda2b.png5a4cc1405e97b_Capturadepantalla2018-01-03alas12_24_33.thumb.png.299dcc00fd4d20092125d218a8a11a5a.png5a4cc13fc5809_Capturadepantalla2018-01-03alas12_23_55.thumb.png.d30eb3c66bbe2592f749ecfed6d2bc59.png5a4cc13f0a3da_Capturadepantalla2018-01-03alas12_18_36.thumb.png.3099cc44ee36cc52f13a4fd9023eee55.png

 

NOTE: The language is mixed due to URLS used to get those errors but are correctly shown in each language as it should. The problem is just that it does not redirect to the 404 default template.

 

Thank you very much in advance!

 

 

Edited by dellhph
Added prestashop version (see edit history)

Share this post


Link to post
Share on other sites

Hi,

When a product is not found the ProductController send a 404 code and display the error message in the product template.
As the same behavior is used for CMS, category and other objects, 404 are shown by different templates.

If you want to avoid this (unify so)  you could develop a module hooked on actionDispatcher and that changes the current controller for the real 404 one (yes it exists!) before ProductController, CMSController etc are fired.

I can do it for cheap if you need it.

 

 

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
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More