Post by shetab24 » Thu Apr 21, 2011 2:17 am

hello all
this is my first post in here :)
i have changed my shop from something to OC.
all my indexed link routing to 404 page. page not found.
how can i Redirect 404 page to special page like homepage or whatever page in my host by using htaccess?
this code does'nt work for me.

Code: Select all

ErrorDocument 404 /index.php

Newbie

Posts

Joined
Sat Apr 16, 2011 8:11 pm

Post by justinv » Thu Apr 21, 2011 9:38 am

OpenCart handles all pages, even those where the request is not found with this controller here:

catalog/controller/error/not_found.php

Documentation: OpenCart User Guide
Mods: Total Import PRO | CSV Import PRO | Ecom Tracking | Any Feed | Autosuggest | OpenCart CDN
Image


Active Member

Posts

Joined
Tue Oct 12, 2010 1:24 pm

Post by shetab24 » Thu Apr 21, 2011 3:43 pm

justinv wrote:OpenCart handles all pages, even those where the request is not found with this controller here:

catalog/controller/error/not_found.php
okey
in fact is there any way to steer the default page (not_found.php) to home page(index.php) or anywhere else in the host?

Newbie

Posts

Joined
Sat Apr 16, 2011 8:11 pm

Post by justinv » Fri Apr 22, 2011 1:07 pm

In the controller file that I mentioned you would need to put this:

Code: Select all

$this->redirect('http://www.yoursite.com/index.php");
before the line that starts with something like this:

Code: Select all

$this->render(........)

Documentation: OpenCart User Guide
Mods: Total Import PRO | CSV Import PRO | Ecom Tracking | Any Feed | Autosuggest | OpenCart CDN
Image


Active Member

Posts

Joined
Tue Oct 12, 2010 1:24 pm

Post by seoadsem » Thu Mar 21, 2013 4:46 am

It works, but in this case you won't be able anymore to change the currency. It will send you to a blank page.

Newbie

Posts

Joined
Mon Aug 27, 2012 1:50 am

Post by butte » Sat Mar 30, 2013 11:54 am

The point of 404 and other standard error pages is to show the problem, not hide it. Apache has a small standard set of them. Your server may allow you to use your own custom error pages, but the general response you will face (from support and from the experienced) if you try to nullify error pages is amusement. You might as well ask how you can hide your license plates at the wrong times, or how your ambulance service can defeat all of the emergency lighting and siren switches. With custom error pages you can provide a link to where you would like people to end up (or restart), and you can tailor what they're shown about the error. Servers' own customized error pages often advertize their own services and rates ("Surprise, this is a booboo page, the website you're visiting just blew it, but, lo, we host it and you, too, can sign up right here!"). Yours doesn't have to attempt to do that.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by hassanalishah » Wed Sep 13, 2017 5:57 pm

justinv wrote:
Fri Apr 22, 2011 1:07 pm
In the controller file that I mentioned you would need to put this:

Code: Select all

$this->redirect('http://www.yoursite.com/index.php");
before the line that starts with something like this:

Code: Select all

$this->render(........)
I tried this but i am getting below error:

arse error: syntax error, unexpected ''https://www.q-depot.com/index' (T_ENCAPSED_AND_WHITESPACE) in /home/qdepot55/public_html/catalog/controller/error/not_found.php on line 68

Could you please assist on this? Thanks!

New member

Posts

Joined
Wed Sep 17, 2014 1:45 pm
Who is online

Users browsing this forum: No registered users and 30 guests