Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#26 04-25-2013 07:57:21

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: How to Make CCP8 return a 404 error code for pages not found

Can you post the full mod you did to CMS_Content.php?  Just the mod and it's location.  Thanks.


Nick Hendler

Offline

 

#27 04-25-2013 08:29:05

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: How to Make CCP8 return a 404 error code for pages not found

I have tried all manner of variations on this theme without success. I removed the http://www.quasarelectronics.co.uk from the start of the current line as it was pulling unsecured 404 page into https pages and stopping the padlock from appearing.

I have just completed testing this on another server running Plesk 10 under our .com domain and find exactly the same problem occurs. This only code mod on that install is this one below. Rem out "RewriteRule ^(.*) index\.php?COREseourl=/$1 [L,PT]" and 404 is returned.

if (empty($result[0]['htmlcontent'])) {

// Custom 404 Mod
$this->globals('core_display.suppress_skin',1);

header('HTTP/1.1 404 Not Found');
// header('Location: ' . $this->CORE_Display->link_namespace('cms','display',array('ref'=>'splash')));
// header('Location: ' . $this->CORE_Display->link_namespace('cms','display',array('ref'=>'error404.shtml')));
header('Location: error404.shtml');
return 1;

     if ($this->debug) {$this->debugger("display: No content available for reference '{$reference}'.  App: cms");}

} else {

// +--
// | Handle visibility.
// +--

Last edited by sdn (04-25-2013 08:45:28)


Simon

Offline

 

#28 04-26-2013 08:01:01

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: How to Make CCP8 return a 404 error code for pages not found

The problem is the line:

Code:

header('Location: error404.shtml');

This is causing the redirect.  It might be better to change that line to:

Code:

@include('/path/to/error404.shtml');

Or something similar.


Nick Hendler

Offline

 

#29 04-26-2013 08:34:16

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: How to Make CCP8 return a 404 error code for pages not found

Hurrah! At last it bloody well works! So not a problem with our server setup in the end. 2 months to the day that I started this post. Thanks to your perseverance.


Simon

Offline

 

#30 04-27-2013 02:48:46

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: How to Make CCP8 return a 404 error code for pages not found

That should be half a hurrah. This solves the problem of non-existent pages outside the cart i.e. our old .htm pages that CCP replaced. Google will now see those as 404s.

However, non-existent pages inside CCP like "/Item/just-one-of-many-discontinued-product-pages" still return a 200 and don't even redirect to a different url. How is Google supposed to know when to drop deleted pages?

As supplied CCP delivers the page "/Item/just-one-of-many-discontinued-product-pages" with the message "The item you selected cannot be viewed. Please make a selection from the menu to continue".

Googlebot is not going to read that message but it will read the “index,follow” instruction and the generic meta title and description the page has now been given. Googlebot helpfully keeps the page in it's index but updates the title and description and then penalises you for having lots of pages with duplicate content.

Don't get me wrong, I think CCP is on the whole a great product but it is pretty frustrating to find I have been chasing my tail on this issue for two months. I have spent a huge number of hours trying to get a solution including trialling two new hosting companies and god only knows how many emails to our current host (who have actually been pretty good about it all).

As for our Google rankings, I cannot even bring myself to make a full analysis of the damaged wreaked or the business lost. I cannot blame just this one issue as we made a few of our own errors but it certainly did not help.

Last edited by sdn (04-27-2013 11:59:52)


Simon

Offline

 

#31 04-29-2013 08:11:20

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: How to Make CCP8 return a 404 error code for pages not found

We're going to be adding 404 capabilities within the software in one of the next few updates.  To produce 404s for missing products, make a similar mod in the file {private}/apps/ecom/ECOM_Prod/ECOM_Prod.php in this code block:

Code:

if (empty($product)) {

     if ($this->debug) {$this->debugger("prodshow: Product information is not available.");}

     $this->print_message('ecom','invaliditem');

     return 1;

} // End of if statement.

And for categories, do so in {private}/apps/ecom/ECOM_Cat/ECOM_Cat.php at this code block:

Code:

if (($this->IsError($result)) || (empty($result))) {

     $this->CORE_Display->include_file('ecom','noitems.php');

     if ($this->debug) {$this->debugger("catshow: Did not locate a category to display.  App: ecom");}

     return 1;

} // End of if statement.

Nick Hendler

Offline

 

#32 04-29-2013 15:15:51

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: How to Make CCP8 return a 404 error code for pages not found

As I am sure you realise, PHP is not in my skill set but I am starting to see what some of the code is doing now which is a help. It is quite a learning curve when you have only worked with FrontPage before.

I did not expect to be tinkering about in the bowels of the carts operation quite as much as I have especially on this issue. I don't think it is unreasonable to expect such basic housekeeping to work out of the box. I am at a lose to understand why it has taken two months to be provided with a solution. It is actually extremely simple - when you know how.....

Now I really need to concentrate my efforts on trying to rebuild our search rankings and traffic.

Last edited by sdn (04-30-2013 05:27:52)


Simon

Offline

 

#33 04-30-2013 07:59:06

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: How to Make CCP8 return a 404 error code for pages not found

If you're not adept at coding in PHP, perhaps requesting PHP-based mods on the forum is not the way to go for you.  We have a Custom Shop where you can queue jobs for us to complete for you if you have no coding experience.

Introducing 404s into the software is slated for our next update.  When we release the update that will become a stock feature.


Nick Hendler

Offline

 

#34 04-30-2013 10:27:59

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: How to Make CCP8 return a 404 error code for pages not found

Please to hear the mod will be included next release.

Making minor changes to the code is not really that difficult if you are told what to do and you approach it sensibly by taking copies of the original files.

I have been very impressed with the support forum. All of my other topics have been answered promptly and I have implemented the changes without problem.

Anyway, I will bear your service in mind if a job looks too complicated.


Simon

Offline

 

#35 06-29-2013 03:52:28

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: How to Make CCP8 return a 404 error code for pages not found

Now 8.0.5 is released can you confirm if we still need this line in our htaccess file:

ErrorDocument 404 /404.shtml

ALSO

Why is this page redirectly to our home page with a 200 success code?  It is an old page that no longer exists and not in our htaccess redirects. It should not be redirecting as Google are picking it up a duplicate conent,

http://www.quasarelectronics.co.uk/khxc … 3.127.html

Last edited by sdn (06-30-2013 00:43:08)


Simon

Offline

 

#36 07-01-2013 07:53:43

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: How to Make CCP8 return a 404 error code for pages not found

if you update to 8.0.5, you will not need to specify that 404 in your .htaccess (if ClickCartPro handles all of the requests / ie. your ClickCartPro install is in your root web directory). 

I can't tall you why that old page is redirecting to your homepage.  Are you sure you don't have a rule in your .htaccess that rewrites '/khxc' requests to '/'?


Nick Hendler

Offline

 

#37 07-02-2013 12:23:22

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: How to Make CCP8 return a 404 error code for pages not found

I have done a bit more testing. It is not out htaccess file.

The CCP demo site also goes to the home page if you include "gbu0-catshow" or "gbu0-prodshow" in the URL and it returns a 200 success server response.

We would prefer it to return a 404 page not found to avoid duplicate content issues. Please try this link and you will see what I mean.

Code:

https://kryptronic.com/demoeu/gbu0-catshow/nosuchpage.html

Last edited by sdn (07-03-2013 09:54:28)


Simon

Offline

 

#38 07-03-2013 14:17:12

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: How to Make CCP8 return a 404 error code for pages not found

Try:

https://kryptronic.com/demoeu/nosuchpage.html

You're trying to access a non-existent namespace with v6 code on a v8 install with the URL you posted.


Nick Hendler

Offline

 

#39 07-03-2013 14:27:25

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: How to Make CCP8 return a 404 error code for pages not found

The pages are not non-existent to Google.

Having had urls in CCP6 format and new urls in CCP8 format they will not be purged by Google if they keep returning a 200 success code. Google are instead treating them as duplicate content. We do not want to redirect them all in htaccess and robots.txt is not flushing them out.

Last edited by sdn (07-03-2013 14:29:39)


Simon

Offline

 

#40 07-03-2013 14:35:57

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: How to Make CCP8 return a 404 error code for pages not found

Put this in your .htaccess above your v8 rules to handle 99% of them:

Code:

RewriteRule ^gbu0-display/(.*)\.html$ http://www.yourdomain.com/$1 [L,R=301]
RewriteRule ^gbu0-prodshow/(.*)\.html$ http://www.yourdomain.com/Item/$1 [L,R=301]
RewriteRule ^gbu0-catshow/(.*)\.html$ http://www.yourdomain.com/Category/$1 [L,R=301]

Otherwise the software will automatically translate those into v7 URLs, and if you have SEO enabled, will automatically do a 301 over to the v8 SEO URL.


Nick Hendler

Offline

 

#41 04-06-2014 14:36:53

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: How to Make CCP8 return a 404 error code for pages not found

I have done the above but Google has once again included these non-existent pages (hundreds of them) as duplicate content on our domain root. The pages are returning the following response rather than a 40ow to fix this? CCP gives the impression that a 404 is being returned at it displays the "page not found" page. This problem is once again having a significant effect on our search rankings.

Fetch as Google

This is how Googlebot fetched the page.

URL: http://www.quasarelectronics.co.uk/avsl … hpage.html

Date: Sunday, April 6, 2014 at 12:35:49 PM PDT

Googlebot Type: Web

Download Time (in milliseconds): 266

HTTP/1.1 301 Moved Permanently
Date: Sun, 06 Apr 2014 19:35:49 GMT
Server: Apache
Location: http://www.quasarelectronics.co.uk/nosuchpage
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 211
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.quasarelectronics.co.uk/nosuchpage">here</a>.</p>
</body></html>


Simon

Offline

 

#42 04-07-2014 09:32:09

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: How to Make CCP8 return a 404 error code for pages not found

Are you running version 8.0.7 with the new 404 logic in it?  It makes most of what was listed in this thread irrelevant.  You're probably experiencing an issue due to an older 'gbu0' redirect rule and a lack of 404 support in CCP (due to an older version, it supports 404s as of 8.0.7).


Nick Hendler

Offline

 

#43 04-07-2014 09:56:50

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: How to Make CCP8 return a 404 error code for pages not found

Yes we run 807. What file is responsible for handling the 404 redirects (maybe we corrupted it)?

Since 807 I thought I had seen the last of this problem as my testing showed correct 404 being returned for the duplicate content in WMT (and they dropped out).

I added the redirects suggested above when they showed up in WMT last month. I have today amended them to R=404. This may not be the ideal solution but it does at least keep Google happy.

Last edited by sdn (04-07-2014 14:25:29)


Simon

Offline

 

#44 04-09-2014 09:11:49

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: How to Make CCP8 return a 404 error code for pages not found

If you're running 8.0.7, then most of what's in this post is already in the software, in a much better format than posted here.  I'd recommend removing all of the 404-based rules you have here and let the software do the work.  The 404s are generated by the file:

{private}/core/CORE_FrontEnd/ext/notfound.php


Nick Hendler

Offline

 

#45 04-15-2014 05:28:24

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: How to Make CCP8 return a 404 error code for pages not found

I checked the file notfound.php and it is at 8.0.4. Is that the latest version?


Simon

Offline

 

#46 04-15-2014 09:19:19

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: How to Make CCP8 return a 404 error code for pages not found

Yes.  The entire file boils down to:

Code:

header('HTTP/1.1 404 Not Found');
$this->print_message('core','notfound');

Nick Hendler

Offline

 

#47 04-15-2014 09:46:20

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: How to Make CCP8 return a 404 error code for pages not found

Thanks.

What drives CCP8 to return a 301 for the old CCP pages like gbu0-display, gbu0-prodshow, etc?


Simon

Offline

 

#48 04-16-2014 09:36:16

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: How to Make CCP8 return a 404 error code for pages not found

The gbu0xx pages are handled with the .htaccess rewrite rules:

Code:

# Old SEO Rule Rewrites

RewriteRule ^ccp0-display/(.*)\.html$ index.php?app=cms&ns=display&ref=$1 [L,PT]
RewriteRule ^ccp0-dynform/(.*)\.html$ index.php?app=cms&ns=dynform&ref=$1 [L,PT]
RewriteRule ^ccp0-(.*)/(.*)\.html$ index.php?app=ecom&ns=$1&ref=$2 [L,PT]

RewriteRule ^gbu0-display/(.*)\.html$ index.php?app=cms&ns=display&ref=$1 [L,PT]
RewriteRule ^gbu0-dynform/(.*)\.html$ index.php?app=cms&ns=dynform&ref=$1 [L,PT]
RewriteRule ^gbu0-(.*)/(.*)\.html$ index.php?app=ecom&ns=$1&ref=$2 [L,PT]

Nick Hendler

Offline

 

Board footer