Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

My shop can't be indexed! (No, really!)


Micke

Recommended Posts

Hi All!

 

I've got a problem. None of the bots can index my shop.

I started this thread (Thanks Les!) earlier but I thought I'd start fresh with this one.

My shop is really a RC1 shop so the name of the topic was not very good...

 

A tech at Google has now verified that the googlebot is denied access to my shop.

Using an on-line validator and two test files in my shop's root we can see what happens.

 

Here is the source for testphp.php (some Swedish in there, but don't worry...)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Valideringstest</title>
</head>

<body>
<h1>Rubik nummer 1 </h1>
<p>Brödtext som står under rubriken.</p>
<p><a href="http://www.designen.se">Länk till designen</a> </p>
<?php echo "Denna rad skrivs med php-script..."; ?>
</body>
</html>

Click here for validating testphp.php

Click here for opening testphp.php in the browser (please have a look at the source code in the browser).

As you can see, everything's OK!

 

But, if we include application_top.php in the same file. Like this:

<?php

include_once('includes/application_top.php');

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Valideringstest</title>
</head>

<body>
<h1>Rubik nummer 1 </h1>
<p>Brödtext som står under rubriken.</p>
<p><a href="http://www.designen.se">Länk till designen</a> </p>
<?php echo "Denna rad skrivs med php-script..."; ?>
</body>
</html>

Click here for validating testosc.php

Click here for opening testosc.php in the browser (please have a look at the source code in the browser).

As you can see, when I include application_top.php we have a "Line 1, Column 0: end of document in prolog" in the validator (this is access denied for our good friend googlebot).

You can also see that the source code is exactly the same in both cases.

 

There is one more clue... I have two sitemap contributions. One including application_top.php (here's the output) and another one that does not (here's the output from that one)

 

Can we agree that the problem is somewhere in application_top.php?

Anyone out there knows what to do?

 

//Micke

Link to comment
Share on other sites

I would guess that application_top.php or another php file is outputting before the doctype.

Link to comment
Share on other sites

And crying, "Foull!" (that there's a "major bug" in the code) before all other possibilities have been exhausted is a bit premature, in my opinion.

 

Especially since there are hundreds (if not thousands) of installs that DON'T have this problem.

 

Other possibilities:

 

1. "Corrupt" source file(s).

 

2. "Corrupt" installation.

 

3. Server misconfiguration/problem.

 

4. "LNBTK" Syndrome (the infamous "Loose Nut Behind The Keyboard" - It's got me more than once :blush: )

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Since all we are talking about seems to be an errant blank line, could it come from that blank line being in front of or behind the php tags in one of the subsequent includes? Just a half-educated guess, seeing that I have never tried it ...

Even at a Mensa convention someone is the dumbest person in the room.

Link to comment
Share on other sites

The error, blank line or not - Why can't it be seen in the source?

Google tech hinted that there might be a "error in a server side script not generating an error message" and that there were different settings for this in the setup of the server.

And I've got loose nut up to my knees...

//Micke

Link to comment
Share on other sites

Hi All!

 

I think I'm getting somewhere...

I took all included (and required) files in application_top.php and included (or required) them in two new test files.

Found out that the problem starts when I try to include includes/classes/sessions.php

Here's testoscincludes_1.php

<?php

// include_once('includes/application_top.php');
require('includes/configure.php');
require('includes/functions/compatibility.php');
require('includes/database_tables.php');
require('includes/functions/database.php');
include('includes/functions/gzip_compression.php');
require('includes/functions/general.php');
require('includes/functions/html_output.php');
include('includes/functions/cache.php');
require('includes/classes/shopping_cart.php');
// include('includes/classes/sessions.php');
require('includes/functions/sessions.php');
require('includes/classes/currencies.php');
require('includes/classes/mime.php');
require('includes/classes/email.php');
include('includes/classes/language.php');
include_once('includes/classes/seo.class.php');
require('includes/functions/whos_online.php');
require('includes/functions/password_funcs.php');
require('includes/functions/validations.php');
require('includes/classes/split_page_results.php');
require('includes/classes/boxes.php');
require('includes/functions/banner.php');
require('includes/functions/specials.php');
require('includes/classes/breadcrumb.php');
require('includes/functions/articles.php');
require('includes/functions/article_header_tags.php'); 
require ('includes/classes/sts.php');
require('includes/classes/oscthumb.php');
require('includes/classes/message_stack.php');
require('includes/functions/clean_html_comments.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Valideringstest</title>
</head>

<body>
<h1>Rubik nummer 1 </h1>
<p>Brödtext som står under rubriken.</p>
<p><a href="http://www.designen.se">Länk till designen</a> </p>
<?php echo "Denna rad skrivs med php-script..."; ?>
</body>
</html>

Click here to validate it.

 

...and here's testoscincludes_1.php

<?php

// include_once('includes/application_top.php');
require('includes/configure.php');
require('includes/functions/compatibility.php');
require('includes/database_tables.php');
require('includes/functions/database.php');
include('includes/functions/gzip_compression.php');
require('includes/functions/general.php');
require('includes/functions/html_output.php');
include('includes/functions/cache.php');
require('includes/classes/shopping_cart.php');
include('includes/classes/sessions.php');
require('includes/functions/sessions.php');
require('includes/classes/currencies.php');
require('includes/classes/mime.php');
require('includes/classes/email.php');
include('includes/classes/language.php');
include_once('includes/classes/seo.class.php');
require('includes/functions/whos_online.php');
require('includes/functions/password_funcs.php');
require('includes/functions/validations.php');
require('includes/classes/split_page_results.php');
require('includes/classes/boxes.php');
require('includes/functions/banner.php');
require('includes/functions/specials.php');
require('includes/classes/breadcrumb.php');
require('includes/functions/articles.php');
require('includes/functions/article_header_tags.php'); 
require ('includes/classes/sts.php');
require('includes/classes/oscthumb.php');
require('includes/classes/message_stack.php');
require('includes/functions/clean_html_comments.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Valideringstest</title>
</head>

<body>
<h1>Rubik nummer 1 </h1>
<p>Brödtext som står under rubriken.</p>
<p><a href="http://www.designen.se">Länk till designen</a> </p>
<?php echo "Denna rad skrivs med php-script..."; ?>
</body>
</html>

Click here to validate it.

 

Now, you'd think that if I comment out that same file from application_top.php all will be fine?

No, it does not work that way..

Even if I comment out this whole section...

// check if sessions are supported, otherwise use the php3 compatible session class
 if (!function_exists('session_start')) {
define('PHP_SESSION_NAME', 'osCsid');
define('PHP_SESSION_PATH', $cookie_path);
define('PHP_SESSION_DOMAIN', $cookie_domain);
define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);

include(DIR_WS_CLASSES . 'sessions.php');
 }

... the shop is still restricted from the validator and the bots...

 

Is there someting else You can think of?

Is there another chunk of code in application_top.php that does the same thing includes/classes/sessions.php does?

 

//Micke

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...