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.

#1 08-08-2008 14:04:39

cfunderburg
Member
Registered: 12-05-2006
Posts: 91

Bad Links Return to Splash Page

For purposes of discovering broken URLs, I would like to disable the feature that redirects bad links to user html pages to the splash page so that a 404 message is displayed. Same thing with Items and Categories. This will allow me to use an automated broken link checker. Any thoughts on how to accomplish this?

Offline

 

#2 08-08-2008 15:50:24

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Bad Links Return to Splash Page

The code that does that direction to the splash page is in the file ste_exec.pl.  Specifically:

Code:

##########
########## If we still don't have a match, we loop back through the
########## system database once more, and pick the splash page
########## as our default page.
##########

if ($page_matched eq "N") {

$fd_pg = "ste_splash";

That appears around line 274, give or take.  The best you'd probably be able to do though is change it to a different page.  Perhaps you could make a dedicated error page (User HTML page) and put that page ID in there instead.  Otherwise, I don't know how you'd accomplish it, since once cp-app.cgi is called, it has to present some page and won't simply go to a 404 (the script is found, so not a 404 situation).


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#3 08-09-2008 18:04:34

cfunderburg
Member
Registered: 12-05-2006
Posts: 91

Re: Bad Links Return to Splash Page

Hmmm. I could do that, but the bad link checking program is looking for an HTTP return of 404 to determine if a link is bad.

Offline

 

#4 08-10-2008 05:14:09

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Bad Links Return to Splash Page

Forgive me for jumping in but we had a similar discussion about bad links and 404 being returned in one of the CCP 6 fora not long ago.  A "bad" link in CCP really isn't a bad link per se and will never return a 404.  That's done mainly to keep the customer in the store and present them with options to continue shopping rather than giving them a somewhat cryptic 404 page (even one that's customized).

Offline

 

#5 08-10-2008 15:02:24

cfunderburg
Member
Registered: 12-05-2006
Posts: 91

Re: Bad Links Return to Splash Page

Dave, is there anyway to 'disable' this via the programming to instead return a 404? I would rather fix the broken links than drop the customer to the splash page. That's probably more annoying to the customer and difficult to find and fix than just a 404.

Offline

 

#6 08-10-2008 17:52:11

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Bad Links Return to Splash Page

With 5.1 I really don't have a clue (Rachael might though).  I never really worked with 5.1 much at all.  FWIW 6 does the same thing and it couldn't, easily, be changed.  Whether or not a default page is displayed or a 404 is returned can be, and has been, subject to a great deal of debate.

Offline

 

#7 08-10-2008 19:22:30

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Bad Links Return to Splash Page

I do not know of any way to do it.  Any CCP link, such as an outdated product or page, is necessarily going to the cp-app.cgi script.  The specific product or page is determined only by variables that come after the cp-app.cgi.  Even though the variables might be useless and the product or page might not actually be in the database, the script does in fact exist on the server.  The 404 page is returned by the server, not CCP (or any other client software), and the server only throws a 404 when the destination doesn't exist.  Since the script does exist, even when the variables supplied are useless, that will never generate a 404.

The only way I could think to do it, which may or may not work for your link checking script, is this:  Make a new user HTML page in CCP.  Make the only contents of that page a META redirect to a nonexistent static HTML page.  Then make CCP go to that page for the default, as I showed above.  The redirect will get you to your 404 - it will be after an intermediate page, so it might not work with your checker, but that's the best I can do.  And honestly, I don't see how it could be any other way, based on how servers and CCP work.


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#8 08-12-2008 08:06:42

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Bad Links Return to Splash Page

I've actually had this mod done by ATS some time ago.

If a url is not found it goes to the "We don't have that product anymore" page, and returns a 404 header so I wouldnt get dupe content by having a ton of links directed to the same page.

I have an idea of how he did it and can find some of the code.... but not sure if it is all of it needed or not.


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#9 08-12-2008 10:42:11

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Bad Links Return to Splash Page

Post removed by owner.

Last edited by rachaelseven (08-12-2008 15:30:12)


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#10 08-12-2008 15:29:43

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Bad Links Return to Splash Page

Marty and I have discussed this off-forum and I have decided to withdraw my request.  This is much more complex than it at first appears and is well beyond the scope of the forum, imho.  It also might involve proprietary code, so I am going to leave this one lie.  I would suggest contacting Stephen at CartMod and requesting a quote if this is something you need.


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

Board footer