Zen Cart Logo
Forums / Basic Configuration / Redirects for "page not found"

Redirects for "page not found"

Views: 1,444

Results 1 to 4 of 4
26 Jun 2013, 4:39 PM
#1
ocmusic avatar

ocmusic

New Zenner

Join Date:
Jun 2013
Location:
Orange County, CA
Posts:
27
Plugin Contributions:
0

Redirects for "page not found"

I did a search in the forums for "redirects" and "page not found" but couldn't find an answer (at least one I understood)

A lot of us noobies are constantly changing pages as we are getting the feel of Zen Cart. Some of the older pages have already been ranked with google, which is great but the viewer is directed to my website page with a message saying "that page was not found". I'm curious to know if there is anyway you can direct outdated pages to your home page. So if the url is mywebsite.com//index.php?main_page=index&cPath=22 and that page is no longer a valid page in my website, I'd like to redirect it back to the home page.

I know eventually the problem will be solved when Google re-index's my site but I was curious if this can be done (without a programming degree from M.I.T)

26 Jun 2013, 5:49 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,097
Plugin Contributions:
56

Re: Redirects for "page not found"

See your admin's Configuration->My Store->Missing Page Check. Set the value to 'On' (redirect to home page).

28 Jun 2013, 2:17 PM
#3
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,803
Plugin Contributions:
15

Re: Redirects for "page not found"

Also, Google "zen cart custom 404 page"

28 Jun 2013, 8:37 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Redirects for "page not found"

ocmusic:

constantly changing pagesNot sure exactly what you mean by "changing pages". By "pages", are you actually talking about categories? That's somewhat implied in the rest of your post, but it's a bit unclear, for reasons I will explain:

ocmusic:

Some of the older pages have already been ranked with google, which is great but the viewer is directed to my website page with a message saying "that page was not found".The proper 'page not found' message only occurs when someone clicks a link to a page that actually doesn't exist. Such as index.php?main_page=fred or no_page_here.php

It does not appear when someone clicks a link to a removed category. If you've removed a category, the visitor sees a simple "No products in this category" message, and the search engine is also told in the background to remove this page from their index so they don't keep providing it in search results.

ocmusic:

I'm curious to know if there is anyway you can direct outdated pages to your home page. So if the url is mywebsite.com//index.php?main_page=index&cPath=22 and that page is no longer a valid page in my website, I'd like to redirect it back to the home page.
But, if you really want to blindly push your visitors to the home page instead of telling them that the link they clicked (or more importantly that maybe they had bookmarked) is invalid, you could make the following coding change to /includes/modules/pages/index/header_php.php around line 55:```
if ($category_depth == 'products' && $listing->RecordCount() == 0) [B]/*[/B] $robotsNoIndex = true;[B] */ zen_redirect(zen_href_linkFILENAME_DEFAULT));[/B]