Post by daze50 » Sat Jul 31, 2010 1:52 am

Hi I’m not great (understatement) with this .php, so is there a general 404.php page available as I was going through the seo tools with google and it reports I’m missing one.

I do know what it is, but implementing a .php on is something I could do with a quick bit of advice on.

Cheers all 8)

New member

Posts

Joined
Mon Jul 12, 2010 2:08 am

Post by Xsecrets » Sat Jul 31, 2010 5:30 am

well if you are talking about a generic 404 if an image is not found or something then that has to do with your hosting setup not opencart. If you are talking about when you try to enter and opencart type url for a product/category that doesn't exist opencart does have a 404 page that handles that.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by JAY6390 » Sat Jul 31, 2010 7:30 am

You can add a .htaccess line that will do what you want

Code: Select all

ErrorDocument 404 /index.php?route=error/not_found
This will redirect to the not found page of opencart for any file not found. Be sure to have it at the top of the .htaccess file. Note that if your cart is in a folder called shop you will have to add /shop before the /index

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Xsecrets » Sat Jul 31, 2010 10:45 am

Nice one I'll have to remember that.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by daze50 » Sun Aug 01, 2010 5:05 pm

Thants great thanks all

New member

Posts

Joined
Mon Jul 12, 2010 2:08 am

Post by kingdonk » Sun Jan 09, 2011 1:10 pm

Can you copy, edit then save the not found page as a new document say 403 then add ErrorDocument 403 /index.php?route=error/403 to the .htaccess file to make custom pages for other kinds of errors?

Newbie

Posts

Joined
Wed Dec 22, 2010 6:03 pm

Post by philbydevil » Sun Jan 09, 2011 8:07 pm

You can add a .htaccess line that will do what you want
CODE: SELECT ALL
ErrorDocument 404 /index.php?route=error/not_found


This will redirect to the not found page of opencart for any file not found.
Doesn't OC already redirect to the not found page automatically (my store seems to - 1.4.9.3)?

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by kingdonk » Sun Jan 09, 2011 8:20 pm

It does for the not found, I'm just on about all the different kind of error codes.

Newbie

Posts

Joined
Wed Dec 22, 2010 6:03 pm

Post by javiecastillo » Fri Jan 14, 2011 1:54 am

How would one do this for multiple sites? Can I specify a different 404 page for each of the individual sites I have using multisite?

Newbie

Posts

Joined
Fri Dec 31, 2010 2:27 am

Post by i2Paq » Fri Jan 14, 2011 2:27 am

You can by using .htaccess and your Information pages.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by javiecastillo » Fri Jan 14, 2011 4:03 am

Nice. Didn't think of that :P

Newbie

Posts

Joined
Fri Dec 31, 2010 2:27 am

Post by kingdonk » Fri Jan 14, 2011 5:33 am

So use a information page and set the order to 0 sothat it is not displayed in the information box all over the site?
Il give this a try.

I did try this before but had the page disabled instead hoping a direct link to it would work but the actual page is disabled and not simply invisible.

Newbie

Posts

Joined
Wed Dec 22, 2010 6:03 pm

Post by i2Paq » Fri Jan 14, 2011 6:08 am

Set it to -1 to hide it from view in the Information pages.

Use: ErrorDocument 404 /index.php?route=information/information&information_id=6 (where 6 is the id of your page).

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by slewman » Sun Sep 01, 2013 8:42 pm

Hi guys,

after trying this solution in the htaccess file (put it right at the top)

ErrorDocument 404 /index.php?route=information/information&information_id=6

I created an information page and named it "404 Error" and made it's sort order -1

404 errors are still call the the not_found.tpl

Can someone point me in the right direction.

Cheers
Daz

Newbie

Posts

Joined
Thu Aug 29, 2013 12:12 am

Post by slewman » Mon Sep 02, 2013 11:27 am

Solved!

For those trolling through all the "custom 404" posts. this is the one that actually works

http://forum.opencart.com/viewtopic.php?f=20&t=54975

Newbie

Posts

Joined
Thu Aug 29, 2013 12:12 am
Who is online

Users browsing this forum: No registered users and 38 guests