Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Google XML Sitemap SEO


Jack_mcs

Recommended Posts

No, I'm sorry but I've no idea what could cause that. No one has ever mentioned such a problem either, that I can recall. The only thing I can think to suggest is that if you have a url rewriter addon installed, try turning it off and re-creating the sitemaps to see if the problem goes away.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

We've got your url-rewriter up and running. Turned it off, reset the caches, but it didn't seem to make a difference. We've got two languages, our default language had an ID of 2, instead of 1, could that be of significance?

Link to comment
Share on other sites

When I run the select

 

 

function GenerateCategorySitemap(){

$quotes = (defined('QUOTES_CATEGORY_NAME') ? " where cd.categories_name NOT LIKE '" . QUOTES_CATEGORY_NAME . "' " : '');

$sql = "SELECT c.categories_id as cID, c.date_added, c.last_modified as last_mod

FROM " . TABLE_CATEGORIES . " c left join " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id

" . $quotes . "

ORDER BY c.parent_id ASC, c.sort_order ASC, c.categories_id ASC";

 

in phpmyadmin I do get the same repetition, two (languages) for each category.

 

The manufacturers select is language independent:

 

 

function GenerateManufacturerSitemap(){

$sql = "SELECT manufacturers_id as mID, date_added, last_modified as last_mod, manufacturers_name

FROM " . TABLE_MANUFACTURERS . " order by manufacturers_name DESC";

Link to comment
Share on other sites

It sounds like the problem is due to the two languages but the code should only be loading one. I don't know why it is loading two in your case. If the two urls are identical, then that's a problem. But if they are indicating the language, it may not be. I haven't seen this happen before so I can't say for sure.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...

Hi Jack,

 

I am setting up a new site/store and I was going through the process of this contribution and I noticed that the sitemap xml links for this contribution are linking to the original source site that I used for my new store.

 

But the products are compleltely different and I of course need the links to point to this store.

 

When I go to mystore.com/googlesitemap/index.php it says everything was generated fine but when I copy and paste the individual links:

Here is your sitemap index: http://www.mystore.com/sitemapindex.xml

Here is your product sitemap: http://www.mystore.com/sitemapproducts.xml

Here is your category sitemap: http://www.mystore.com/sitemapcategories.xml

It shows results that list links from the original site, not the new current site I am working with.

 

I took a copy of "store A" files to make "store B" (this store) but I changed all references of store A in the db, I have no idea how the sitemap is generating these links to the original store and not the new/current store I am working with.

 

Is there a cache I need to empty somewhere or can I uninstall this contribution and then re-install it to be able to have a clean install?

Link to comment
Share on other sites

The path is created using the includes/configure.php file so it seems your setup for the new store is not correct. You can use the diagnostic setting and it will display the path.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The path is created using the includes/configure.php file so it seems your setup for the new store is not correct. You can use the diagnostic setting and it will display the path.

 

There is something odd happening then, because I just checked that file (and the admin side to be sure) and it is correct for the new site.

 

Plus if that file was wrong (still setup for the old site) I would have already noticed the problems with the existing links. But the whole site itself is running good, this was just brought to my attention as I was about to submit the xml sitemap to Google and I saw your note (in the instructions) about double checking the links and sure enough there were wrong.

 

Should I just uninstall the contribution and then re-install it. If so, what would the command for uninstalling the database side of things be? I can delete the files fine, but I am clueless when it comes to db commands.

Link to comment
Share on other sites

It wouldn't help to uninstall/install it since there isn't anything in its code that stores the domain name. It is taken from the configure file. This assumes, of course, that you are using stock file. You could try uploading the files in the pages over what you have. Maybe someone changed the code in them at some point. There may also be a configure file in the includes/local/ directory that is causing the problem, though I would think that would affect the shop too. Other than that, if the shop is working correctly otherwise, I can't even guess at what might be causing it.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@ggrant3

 

Did you set up a cron job to create the files. If so this may be pointing to the old store. Just an idea.

 

I did.

 

But how could it be directing to another store?

 

I setup the cron in my Godaddy account and come to think about it, the entire Godaddy account for this site is completely separate from the other sites' Godaddy account.

Link to comment
Share on other sites

Okay I was playing with this some more today after taking a break to clear my head (and lower my blood pressure) and I found something.

 

While looking at this result on mysite/googlesitemap/index.php

Write /mysiteroot/html sitemapproducts.xml
Generated Google Product Sitemap Successfully
Write /mysiteroot/html sitemapcategories.xml
Generated Google Category Sitemap Successfully
Write /mysiteroot/html sitemappages.xml
Generated Google Pages Sitemap Successfully
Write /mysiteroot/html sitemapindex.xml
Generated Google Sitemap Index Successfully

 

I noticed that there was no "/" at the end of my site root. So I went into my catalog/includes/configure.php file and added a forward slash to the end of the root info in the define('DIR_FS_CATALOG line.

 

Now when I navigate to the /googlesitemap/index.php on my page and then navigate to the /sitemapindex.xml page I get results showing the current website that I am working with. So apparently that forward slash in the catalog/includes/configure.php file that was missing, still allowed my site to work correctly but screwed with this contribution.

 

BUT

 

I tried the other links also and all of them except sitemapproducts.xml is working correctly. The products page is still bringing up the original sites info.

 

I went into the catalog/sitemapproducts.xml page to check the code (out of curiosity) and it is all showing correctly in there. The code written in the file is correct, but when I copy and paste the path listed on sitemapindex.php for the sitemapproducts.xml page it is wrong.

 

Any ideas?

 

I overwrote the files again hoping to clear out and phantom issues. But I get the same results

 

Could I be missing another forward slash somewhere that is affecting just the sitemapproducts.xml file?

 

I just don't understand why inside the file it is written correctly but it is bringing up stuff from somewhere else.

Link to comment
Share on other sites

Everything generated okay execpt for the Google Pages sitemap:

 

Opening /home/regaliap/public_html/sitemapproducts.xml

FS_CAT /home/regaliap/public_html/

Server http://www.regaliapetoskey.com

Save Path /home/regaliap/public_html/

WS_CAT /

Write /home/regaliap/public_html/sitemapproducts.xml

Generated Google Product Sitemap Successfully

 

Opening /home/regaliap/public_html/sitemapcategories.xml

FS_CAT /home/regaliap/public_html/

Server http://www.regaliapetoskey.com

Save Path /home/regaliap/public_html/

WS_CAT /

Write /home/regaliap/public_html/sitemapcategories.xml

Generated Google Category Sitemap Successfully

 

Opening /home/regaliap/public_html/sitemapmanufacturers.xml

FS_CAT /home/regaliap/public_html/

Server http://www.regaliapetoskey.com

Save Path /home/regaliap/public_html/

WS_CAT /

Write /home/regaliap/public_html/sitemapmanufacturers.xml

Generated Google Manufacturers Sitemap Successfully

 

ERROR: Google Pages Sitemap Generation FAILED!

 

Opening /home/regaliap/public_html/sitemapindex.xml

FS_CAT /home/regaliap/public_html/

Server http://www.regaliapetoskey.com

Save Path /home/regaliap/public_html/

WS_CAT /

Write /home/regaliap/public_html/sitemapindex.xml

Generated Google Sitemap Index Successfully

 

Array

(

[QUERY] => Array

(

[PRODUCTS] => Array

(

[sTATUS] => success

[NUM_ROWS] => 113

)

 

[CATEOGRY] => Array

(

[sTATUS] => success

[NUM_ROWS] => 16

)

 

[MANUFACTURERS] => Array

(

[sTATUS] => success

[NUM_ROWS] => 34

)

 

)

 

[sAVE_FILE_XML] => Array

(

[0] => Array

(

[file] => /home/regaliap/public_html/sitemapproducts.xml

[status] => success

[file_exists] => true

)

 

[1] => Array

(

[file] => /home/regaliap/public_html/sitemapcategories.xml

[status] => success

[file_exists] => true

)

 

[2] => Array

(

[file] => /home/regaliap/public_html/sitemapmanufacturers.xml

[status] => success

[file_exists] => true

)

 

[3] => Array

(

[file] => /home/regaliap/public_html/sitemapindex.xml

[status] => success

[file_exists] => true

)

 

)

 

)

Link to comment
Share on other sites

The code for the pages sitemap won't work correctly for 2.3, assuming that is what you are using. I have the fix but haven't had time to put it in a package and upload it. It is planned though.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...

Hi Jack, great contribution. My install worked fine the first time, however for some reason it's only adding 150 max products to my sitemapproducts.xml. My sitemapcategories.xml seems to cap at 50. Any ideas why it's capping the number of products/categories? I added additional products and categories today, and the count is still at 150 and 50, it definitely does not seem to be updating.

 

When I run /googlesitemap/index.php from my website, I get the below output (no errors):

 

Write /home/web/public_html/sitemapproducts.xml

Generated Google Product Sitemap Successfully

 

Write /home/web/public_html/sitemapcategories.xml

Generated Google Category Sitemap Successfully

 

Write /home/web/public_html/sitemapindex.xml

Generated Google Sitemap Index Successfully

 

CONGRATULATIONS! All files generated successfully.

Link to comment
Share on other sites

The only limit control is if the size gets to 50,000 since that is a google limit. If it is stopping at 150, there might be some error in one of the files, though I would think you would see an error on the screen if that happened. So I don't have an answer or even a suggestion.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The only limit control is if the size gets to 50,000 since that is a google limit. If it is stopping at 150, there might be some error in one of the files, though I would think you would see an error on the screen if that happened. So I don't have an answer or even a suggestion.

 

I just re-uploaded the latest files and re-ran the update. The category and product count updated, not sure what the issue was but it seems to be resolved! :)

Link to comment
Share on other sites

A new version has been uploaded containing these changes:

 

- Added an Article Manager Topics sitemap.

- Fixed code so pages sitemap will work with all versions of oscommerce.

- Cleaned up code to better handle errors.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi Jack

 

I d/l the most recent version.

 

After installing ran it in diagnostic mode, and this is what I get:

 

Opening /sitemapproducts.xml

FS_CAT /home/mysite/public_html/

Server http://www.mysite.com

Save Path /

WS_CAT /

ERROR: Google Product Sitemap Generation FAILED!

 

Opening /sitemapcategories.xml

FS_CAT /home/mysite/public_html/

Server http://www.mysite.com

Save Path /

WS_CAT /

ERROR: Google Category Sitemap Generation FAILED!

 

Opening /sitemapindex.xml

FS_CAT /home/mysite/public_html/

Server http://www.mysite.com

Save Path /

WS_CAT /

ERROR: Google Sitemap Index Generation FAILED!

 

Array

(

[QUERY] => Array

(

[PRODUCTS] => Array

(

[sTATUS] => success

[NUM_ROWS] => 1573

)

 

[CATEOGRY] => Array

(

[sTATUS] => success

[NUM_ROWS] => 145

)

 

)

 

[sAVE_FILE_XML] => Array

(

[0] => Array

(

[file] => /sitemapproducts.xml

[status] => failure

[file_exists] => false

)

 

[1] => Array

(

[file] => /sitemapcategories.xml

[status] => failure

[file_exists] => false

)

 

[2] => Array

(

[file] => /sitemapindex.xml

[status] => failure

[file_exists] => false

)

 

)

 

)

 

instructions indicate there is supposed to be an install file but it

is not in the zip that I have. Permissions are set correctly. Looks like

something wrong with the paths. Can you steer me in the right direction please?

running php 5.3.19

 

thanks

Link to comment
Share on other sites

Something is wrong with your admin/includes/configure.php file. The following shows what the output should look like. See here for how to set it up.

 

Opening /home/username/public_html/sitemapproducts.xml

FS_CAT /home/username/public_html/googlesitemap/

Server http://www.domain_name.com

Save Path /home/username/public_html/

WS_CAT /

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thanks for the response Jack, but I'm still having the same exact issue.

 

Following is my config file from admin. There are a couple of lines which have been there forever, but I made some changes tonight based on your link and commented them out and replaced them. That did take care of a longstanding (as in forever) issue of backup directory warnings, but I never really used it so it wasn't an issue, and as far as I could ever tell never caused any issues otherwise. I do not know if that was how the original file was setup or some mod required a change - the shop has been up for going on nine years now. Not sure it would or should matter much since either version yields the same results.

 

 

Anyhow, I get the sense that there may be a mixup between FS and WS somewhere. but since my site is fuctioning I suspect the problem is not in the config file at least. Any other ideas?

 

Thanks again!

 

// define our webserver variables

// FS = Filesystem (physical)

// WS = Webserver (virtual)

define('HTTP_SERVER', 'https://www.mysite.com'); // eg, http://localhost or - https://localhost should not be NULL for productive servers

define('HTTP_CATALOG_SERVER', 'http://www.mysite.com');

define('HTTPS_CATALOG_SERVER', 'https://www.mysite.com');

define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module

define('DIR_FS_DOCUMENT_ROOT', '/home/mysite/public_html/');

define('DIR_WS_ADMIN', '/admin/');

define('DIR_FS_ADMIN', '/home/mysite/public_html/admin/');

define('DIR_WS_CATALOG', '/');

define('DIR_FS_CATALOG', '/home/mysite/public_html/');

old line replaced tonight // define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG . '/admin/');

old line replaced tonight // define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG);

define('DIR_WS_IMAGES', 'images/');

 

define('DIR_WS_FLAGS', DIR_WS_IMAGES . 'flags/');

 

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');

define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');

define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

 

// define our database connection

Link to comment
Share on other sites

im trying to upload "google_xml_sitemap_seo.sql" in phpMyAdmin.

im getting error:

INSERT INTO configuration_group( configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible )

VALUES (

'289'
,
'Google XML SEO'
,
'Google XML Sitemap SEO Options'
,
'29'
,
'1'

)

ANYONE KNOWS WHAT AM I DOING WRONG ?

Link to comment
Share on other sites

@@AJRYAN I'm sorry. I know I said admin/includes but I meant includes so that is the wrong file. By the way, and unrelated to this, this line

define('HTTP_CATALOG_SERVER', 'http://www.mysite.com');

should be

define('HTTP_CATALOG_SERVER', 'https://www.mysite.com');

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...