Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo


Recommended Posts

dawson501,

 

Here's an idea. When first loading, the product_info.php code queries the database to see if the product exists. Later in the page, the result ($product_check['total']) is used to determine whether to show the "product not found" message, or the product. That same result could be used to write the robots meta tag:

 

<?php 
 if ($product_check['total'] < 1) {
echo '<meta name="robots" content="noindex,nofollow">';
 }
?>

Just place the if statement somewhere between the <head></head> tags.

 

I know it's not the same as a 404, but it's something. Maybe it'll work.

 

-Skittles

 

You could take it a step further, and use the same result to hide other things, like Header Tags Controller...

 

$product_exists = $product_check['total'];
 if (!$product_exists) {
echo '<meta name="robots" content="noindex,nofollow">';
echo '<title>Product No Longer Available</title>';
 } else {
// Header Tag Controller or other conditional code would go here...
 }

 

As long as there isn't a product, why not save time and bypass additional queries to the database?

 

Just a thought.

 

-Skittles

Link to comment
Share on other sites

Hi and thanks for your help.

 

Unfortunetly the urls are still showing and are basically showing a product not found page. The URL does remain the same though.

 

What i really need is basically page not found, so it looks as though the page didnt exist in the first place.

 

Im not sure how to help this one as this is seriously effecting my rating in google

 

 

Many thanks for helping with this one

 

 

 

:)

Link to comment
Share on other sites

Hi and thanks for your help.

 

Unfortunetly the urls are still showing and are basically showing a product not found page. The URL does remain the same though.

 

What i really need is basically page not found, so it looks as though the page didnt exist in the first place.

 

Im not sure how to help this one as this is seriously effecting my rating in google

Many thanks for helping with this one

:)

dawson501,

 

I work with SEO too, and I know this is a very real issue. That's why I thought the robots tag might help.

 

And for the record, this is a potential problem whether you use some form of search engine friendly URLs or not.

 

It is my understanding Google honors the robots meta tag. So if a page is indexed, then G crawls it and finds the "noindex" command, wouldn't they remove the page from the index? In theory, anyway?

 

Even if someone has a way to force a 404 error, it will still take time for the effect to show up in G, or any other search engine for that matter. And the old pages could still show up in the supplemental results. :(

 

-Skittles

Link to comment
Share on other sites

Hey Chooch thanks for the speedy reply I think this must be the case as another site I have with this mod is working, in terms of update is it just a case of going through every file with winmerge to update? the site it's self is pretty modified :(

 

I assume the files that will need to be updated to fix my problem will be in the includes folder ?

 

Thanks again :thumbsup:

Download the patches and use winmerge - I can't recall which files need to be modded but it doesn't take long.

 

Good Luck

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

I am having a problem. All of the sudden, all of my categories are displaying a page not found error. If I turn of SEO URLS then it works fine. What could be the problem?

 

I'm beginning to think that the upgrade to php5 is causing this problem with SEO URLS because I turned them off in my other shop and reset the category box and all is working fine there but not in the shop that I have the SEO URLS running on.

 

any ideas to fix this?

Link to comment
Share on other sites

Andreas,

 

There is an option in the configuration to "Add category parent to begining of URLs". If you set this to true, the category the product is in will become part of the 'filename'. For example:

would become

instead of

 

Ultimate SEO URLs is not written to show the full path

 

I hope this answers your question.

-Skittles

 

And that's exactely my problem Skittles!! I already activated "add category parent to begining of URLs". But it creates names like:

 

and not

Edited by a.niedermann
Link to comment
Share on other sites

Well Skittles, i've found a post of yours in wich you said that you can modify your store from oscommerce-2.2ms2-060817 version to oscommerce-2.2ms2-051113 version. I did that. I haved configured a new store, i've installed the Ultimate Seo Url's contrib. It was working. I could see my orders in my admin account. After that, i've imported the old database ( from http://www.multiservice-canon.ro ) to the new store. I can see the products and all the settings, but still, i can't see my orders in my admin. The odd thing is that when i enter in my admin url like www.ad-grafx.ro/magazinvirtual/catalog/admin it appears that blue window. At the orders menu, at pending, i can see the number of orders. Should i think it's a problem with my data base???

 

Help will be very appreciated.

Thanks in advance Skittles.

Edited by xperyens
Link to comment
Share on other sites

dawson501,

 

I work with SEO too, and I know this is a very real issue. That's why I thought the robots tag might help.

 

And for the record, this is a potential problem whether you use some form of search engine friendly URLs or not.

 

It is my understanding Google honors the robots meta tag. So if a page is indexed, then G crawls it and finds the "noindex" command, wouldn't they remove the page from the index? In theory, anyway?

 

Even if someone has a way to force a 404 error, it will still take time for the effect to show up in G, or any other search engine for that matter. And the old pages could still show up in the supplemental results. :(

 

-Skittles

 

Hi Skittles, I have added the robot meta tag to my website so hopefully in the next few months i should see an improvement.

 

Google should remove pages from their index if the page is no longer is accessible through the website or their is a robot meta tag

but in my google webmaster account i have 5000+ URLS that google repeats its visit to even though their is no information.

 

Also i dont just want product URL pages to disappear, i have also changed category names which it seriously looks like im spamming

of some kind as i now have basically duplicated pages with exact same information. :( :(

 

I think the next stage of this SEO URL Contribution is to include a feature where URL's can be removed if not needed, or not used anymore. A simple way

in admin to cancel a URL???????

 

Can nobody help?

 

Many thanks

Link to comment
Share on other sites

Well Skittles, i've found a post of yours in wich you said that you can modify your store from oscommerce-2.2ms2-060817 version to oscommerce-2.2ms2-051113 version. I did that. I haved configured a new store, i've installed the Ultimate Seo Url's contrib. It was working. I could see my orders in my admin account. After that, i've imported the old database ( from http://www.multiservice-canon.ro ) to the new store. I can see the products and all the settings, but still, i can't see my orders in my admin. The odd thing is that when i enter in my admin url like www.ad-grafx.ro/magazinvirtual/catalog/admin it appears that blue window. At the orders menu, at pending, i can see the number of orders. Should i think it's a problem with my data base???

 

Help will be very appreciated.

Thanks in advance Skittles.

xperyens,

 

If I understand you correctly, the store using update 051113 allowed you to go into the admin, view the orders, add products to the catalog, etc. while using the sample database. It was only after importing your store's database that the problem occurred.

 

That does hint at a problem with the database. So the next question would be, did you install ALL the modifications you've made to your shop before importing the old database? If not, that might cause a problem.

 

However, if you completed all the mods before importing the database, then I recommend the following actions:

  1. get back to the state where the default (included) sql has all the mods:
    • if you backed up and saved the modified default sql, just reinstall it
    • else if you didn't save the modified sql, reinstall the sql that came with osCommerce and re-do all the sql changes from any contributions you installed. (Just the changes to the database, not the full mod...)

[*]open your store's sql file in a text editor and copy all the tables that deal with your products:

  • categories
  • categories_description
  • manufacturers
  • manufacturers_info
  • products
  • products_attributes
  • products_attributes_download
  • products_description
  • products_options
  • products_options_values
  • products_options_values_to_products_options
  • products_to_categories

[*]create a new sql file with the tables you've copied from your old database.

[*]import the new sql file with your products.

Then place an order and test your Admin.

 

If everything is working, export the configuration table and save it. Then import the configuration table from the old database, and test the admin again.

 

If you see problems after importing the old configuration table, you will need to restore the backup you just did, and enter your store's information and other changes through the Admin.

 

Once everything is working, you can then import your customer tables: customers, and customers_info. (Assuming this is a live shop, and you have existing customers. If not, skip this step.)

 

Let us know how things are going.

-Skittles

 

P.S. Sorry to not get back to you sooner. It's the time difference. Where I am, I'm posting this at 10:16 AM, Saturday, Feb 17.

Link to comment
Share on other sites

Hi Skittles, I have added the robot meta tag to my website so hopefully in the next few months i should see an improvement.

 

Google should remove pages from their index if the page is no longer is accessible through the website or their is a robot meta tag

but in my google webmaster account i have 5000+ URLS that google repeats its visit to even though their is no information.

 

Also i dont just want product URL pages to disappear, i have also changed category names which it seriously looks like im spamming

of some kind as i now have basically duplicated pages with exact same information. :( :(

 

I think the next stage of this SEO URL Contribution is to include a feature where URL's can be removed if not needed, or not used anymore. A simple way

in admin to cancel a URL???????

 

Can nobody help?

 

Many thanks

dawson501,

 

The problem lies in the fact that pages are created dynamically and are dependent on the category id and the product id. It doesn't matter what is in the URL. As long as osCommerce can extract the id, it will create the page, even if it's blank. This is true of virtually all dynamic shopping programs. It's the nature of the beast.

 

What about using the robots.txt file? Is it possible to disallow files using wildcards?

 

If so, you could disallow files that start with the old categories. For example:

 

User-agent: *

Disallow: /catalog/hobby-horses-*.html

Disallow: /catalog/hobby-horses/

 

This would cover both the directory, and any pages that include the directory in their 'filename'.

 

I don't know if this will work, but it could be worth a try. It sounds like it would be a lot of work considering the thousands of pages you mentioned, but you could start with a few (the categories with the most products...?) and see if it makes any difference. If the old pages start disappearing, then you'd know it was worth your time to do it for all the old directories.

 

FYI. I went searching to see if we can use the wildcard in the filename, but couldn't find an answer.

 

If you find something that works, please let us all know.

 

Thanks.

-Skittles

Link to comment
Share on other sites

Hello Skittles. Thanks for reply to my messages. I apreciate that. Now, it seems that the problem is in my data base. In chemo's install instruction he altered 2 fields in my data base structure:

 

`categories_seo_url` varchar(100) NOT NULL default '',

`products_seo_url` varchar(100) NOT NULL default '',

 

Do you think this could be the problem?

I've tried to delete those lines from my data base, but then i get an sql error in phpmyadmin at this line and probably at the lines after:

 

 

INSERT INTO `categories_description` VALUES (21, 1, 'Imprimante', '');

 

 

Thank you Skittles, you really help me out on this one ;) . My yahoo messenger id is: "xperyens".

Link to comment
Share on other sites

Hello Skittles. Thanks for reply to my messages. I apreciate that. Now, it seems that the problem is in my data base. In chemo's install instruction he altered 2 fields in my data base structure:

 

`categories_seo_url` varchar(100) NOT NULL default '',

`products_seo_url` varchar(100) NOT NULL default '',

 

Do you think this could be the problem?

I've tried to delete those lines from my data base, but then i get an sql error in phpmyadmin at this line and probably at the lines after:

INSERT INTO `categories_description` VALUES (21, 1, 'Imprimante', '');

Thank you Skittles, you really help me out on this one ;) . My yahoo messenger id is: "xperyens".

xperyens,

 

You're welcome.

 

You need the two fields in your database, or your categories.php file won't work. You'll get an error message telling you the field is missing, and it will stop loading the page...

 

So does this mean you went back to the default sql, with mods, and everything worked?

 

And that after you added your product related tables, it stopped working?

 

-Skittles

Link to comment
Share on other sites

No. I've configured a new store with data samples. Then, i've dropt all the tables. After that, I've put my old data base (wich contain those two sql lines). The site now connect to the database and sees my tables with all the data, but I have the same problem. I can't view the orders in my admin account. Maybe, if you have an yahoo messenger id, we can communicate much easier, i can send you some files to look at the source codes. I don't know what to do anymore.

Thank you Skittles.

Edited by xperyens
Link to comment
Share on other sites

I am having probelms when adding users to my store after installing the Ultimate SEO URLs.

 

It does not look like it is entering into the database properly, when adding users. If I go into my control panel and click on the new user, nothing happens on my screen, but when I check my log I get this error.

 

Variable passed to each() is not an array or object in /var/www/tranquilsense/admin/includes/classes/object_info.php on line 18, referer: http://www.tranquilsense.com/admin/configuration.php?gID=737&cID=591
PHP Warning:  array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #1 is not an array in /var/www/tranquilsense/admin/customers.php on line 816
PHP Warning:  array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in /var/www/tranquilsense/admin/customers.php on line 816
PHP Warning:  array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in /var/www/tranquilsense/admin/customers.php on line 818
PHP Warning:  reset() [<a href='function.reset'>function.reset</a>]: Passed variable is not an array or object in /var/www/tranquilsense/admin/includes/classes/object_info.php on line 17
PHP Warning:  Variable passed to each() is not an array or object in /var/www/tranquilsense/admin/includes/classes/object_info.php on line 18

 

Has anyone seen this error before

 

Thanks

_________________________________________________________________________

 

David G Aschenbrener

Tranquil | Sense - Your Stop for Tranquility.

Link to comment
Share on other sites

I am having probelms when adding users to my store after installing the Ultimate SEO URLs.

 

It does not look like it is entering into the database properly, when adding users. If I go into my control panel and click on the new user, nothing happens on my screen, but when I check my log I get this error.

 

Variable passed to each() is not an array or object in /var/www/tranquilsense/admin/includes/classes/object_info.php on line 18, referer: http://www.tranquilsense.com/admin/configuration.php?gID=737&cID=591
PHP Warning:  array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #1 is not an array in /var/www/tranquilsense/admin/customers.php on line 816
PHP Warning:  array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in /var/www/tranquilsense/admin/customers.php on line 816
PHP Warning:  array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in /var/www/tranquilsense/admin/customers.php on line 818
PHP Warning:  reset() [<a href='function.reset'>function.reset</a>]: Passed variable is not an array or object in /var/www/tranquilsense/admin/includes/classes/object_info.php on line 17
PHP Warning:  Variable passed to each() is not an array or object in /var/www/tranquilsense/admin/includes/classes/object_info.php on line 18

 

Has anyone seen this error before

 

Thanks

tranquilsense,

 

I haven't seen this.

 

However, I'd be interested in knowing a couple of things:

 

1) What happens if you disable SEO URLs?

2) Have you tried purchasing anything with SEO URLs enabled? What is the order # in the emails?

 

You may be seeing yet another aspect of the incompatibility of Ultimate SEO URLs and Update 060817. Or it may be something else altogether...

 

-Skittles

Link to comment
Share on other sites

tranquilsense,

 

I haven't seen this.

 

However, I'd be interested in knowing a couple of things:

 

1) What happens if you disable SEO URLs?

2) Have you tried purchasing anything with SEO URLs enabled? What is the order # in the emails?

 

You may be seeing yet another aspect of the incompatibility of Ultimate SEO URLs and Update 060817. Or it may be something else altogether...

 

-Skittles

When I disable the seo urls, add a user, it works fine.

 

Have not tried to purchase anything when enabled.

_________________________________________________________________________

 

David G Aschenbrener

Tranquil | Sense - Your Stop for Tranquility.

Link to comment
Share on other sites

HI Fellas

 

I was just wondering, I have a osc shop running this addon but at one time i had a problem and google indexed some urls like.

 

mysite.com/-c-523_740.html

 

it has now been fixed but i am stuck with the urls on the engines like mysite.com/-c-523_740.html and was wondering if theres a way to 404 the old urls so google see's they are not there. Since it still has the CatId's they work when i'd like them not to and then be deindexed. Or maybe its possible to forward them back to what the url should be http://mysite.com/product-stuff-c-523_740.html

 

Any help would be great

Link to comment
Share on other sites

[/b]Hello,

I had to restore my site. Since doing so I now have this error in admin/catalog/Categories / Products:

1054 - Unknown column 'cd.categories_seo_url' in 'field list'

select c.categories_id, cd.categories_name, cd.categories_seo_url, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified, cd.categories_htc_title_tag, cd.categories_htc_desc_tag, cd.categories_htc_keywords_tag, cd.categories_htc_description from categories c, categories_description cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id = '1' order by c.sort_order, cd.categories_name

[TEP STOP]
I think I need to upload the sql changes again. Do I? If so, where do I find the database changes? 

All I found was this: 

ALTER TABLE `categories_description` ADD `categories_seo_url` VARCHAR( 100 ) NOT NULL;
ALTER TABLE `products_description` ADD `products_seo_url` VARCHAR( 100 ) NOT NULL;

But I think that is for updating only. I tried running it & it came up with an error. I did not install this mod I had someone install it for me as it was just a bit to complicated for me. Ive only gotten this error since having my site restored. In my store when you click on a product I get the 404 error message.

Simple instructions on how to fix would be appreciated.

Thanks
[b]

 

Errors fixed now, thanks

 

 

Can someone help me with this please.

 

I have just installed this contribution - although I did not know which version to install from the contribution list version 2.1C added by Chemo added 8 June 2005 - not sure if that was the right one....

 

I now am getting the same error as "Ausgirl" but don't know what to do to fix it.

 

In admin everything is fine in configeration apart from the fact that I have no Categories or Products - I have the following error:

 

1054 - Unknown column 'cd.categories_seo_url' in 'field list'

 

select c.categories_id, cd.categories_name, cd.categories_seo_url, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from categories c, categories_description cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id = '1' order by c.sort_order, cd.categories_name

 

[TEP STOP]

 

and in my live site everything is fine until you go to click on the actual product and I get the following:

 

Fatal error: Call to undefined function: clean_html_comments() in /home/ufthokd/public_html/shop/includes/header_tags.php on line 208

 

I'm not sure how to use the SQL updating of the database that Chemo has quote on his web page on how to install this contribution but I did follow the instructions that came with the download.

 

Run the following sql on your store database:

 

ALTER TABLE `categories_description` ADD `categories_seo_url` VARCHAR( 100 ) NOT NULL ;

ALTER TABLE `products_description` ADD `products_seo_url` VARCHAR( 100 ) NOT NULL ;

 

How do I do this - I have never used SQL to upload a contribution - I always copy the files using my FTP manager. I don't know where to put this code.

 

Sorry if this is a total numpty question but I am struggling with this and I don't know what else to do.

 

Thanks for any help anyone can give.

Link to comment
Share on other sites

HI Fellas

 

I was just wondering, I have a osc shop running this addon but at one time i had a problem and google indexed some urls like.

 

mysite.com/-c-523_740.html

 

it has now been fixed but i am stuck with the urls on the engines like mysite.com/-c-523_740.html and was wondering if theres a way to 404 the old urls so google see's they are not there. Since it still has the CatId's they work when i'd like them not to and then be deindexed. Or maybe its possible to forward them back to what the url should be http://mysite.com/product-stuff-c-523_740.html

 

Any help would be great

 

This is roughly the same problem as with already bot-indexd URLs with session-IDs appended.

 

There is a contribution which rewrites those URLs.

Spider Session Remover

http://www.oscommerce.com/community/contributions,2819

 

You probably have to mod it to your needs (i.e. Rewriterule/Rewritecond without session-id stuff).

 

mikeman

Link to comment
Share on other sites

dawson501,

 

The problem lies in the fact that pages are created dynamically and are dependent on the category id and the product id. It doesn't matter what is in the URL. As long as osCommerce can extract the id, it will create the page, even if it's blank. This is true of virtually all dynamic shopping programs. It's the nature of the beast.

 

What about using the robots.txt file? Is it possible to disallow files using wildcards?

 

If so, you could disallow files that start with the old categories. For example:

 

User-agent: *

Disallow: /catalog/hobby-horses-*.html

Disallow: /catalog/hobby-horses/

 

This would cover both the directory, and any pages that include the directory in their 'filename'.

 

I don't know if this will work, but it could be worth a try. It sounds like it would be a lot of work considering the thousands of pages you mentioned, but you could start with a few (the categories with the most products...?) and see if it makes any difference. If the old pages start disappearing, then you'd know it was worth your time to do it for all the old directories.

 

FYI. I went searching to see if we can use the wildcard in the filename, but couldn't find an answer.

 

If you find something that works, please let us all know.

 

Thanks.

-Skittles

 

 

Hi Skittles, thanks for you help with this one.

 

I think you need a rest, seems everyones jumping on you for answers at the moment, :)

 

Would it not be best for me to simply remove the SEO URL and then re-install it? Bit of a pain

but that might help? Is there anyway of getting hold of Chemo who developed it? Seems he

is invisible at the moment?

 

Thanks again

Dawson

Link to comment
Share on other sites

Hy Skittles. I've uninstalled tha Ultimate Seo Url's contrib. But, i have the same problem. I can't verify my orders in my admin section & my history orders is affected because it's empty. When i make an order, in the auto response in my e-mail, it appears the order number, the product bought and it's price. So the e-mail is ok, meaning that in my database, the information are stored corectly. So the problem must be in a file, and i can't figure wich one. What is your guess? Thanks Skittles.

Link to comment
Share on other sites

..........

 

P.S. This has nothing to do with Ultimate SEO URLs.

 

This is not quite right.

 

I have to correct myself because the appended session_id seems to trigger the "& a m p"-problem (due to the extended param-list?) which leads to failures like "shopping cart empty" or "new logon after checkout" ........

 

So when does the session_id get appended:

 

Case 1:

 

Once when entering the site but:

 

START Quote(from vger):

 

Experienced users will know that osCommerce, even without 'Force Cookie Use' will stop displaying the osCommerce session id within one or two clicks of landing on a website

END Quote

 

Case 2:

 

Wrong Cookie-Domain in "configure.php" (this is nasty)

 

By the way there is a good hint for users who are testing shops on a local-machine in this thread http://www.oscommerce.com/forums/index.php?showtopic=51292

 

Case 3:

 

User browser doesn't allow cookies and "Force cookie use" is set to false (if true shopper can't shop)

 

 

For shop-owners with case 2 and 3 the solution seems to be to not let the &´s beeing translated to a "HTML character entity" by the PHP-function "htmlspecialchars()"

 

The functions (in seo.class.php) are:

 

function href_link()

 

and

 

function stock_href_link()

 

This has already been addressed several times in this thread.

 

There is also a fix in the contrib-section by edgecrush3r (applied on an older "seo.class.php" but the principle is the same).

 

It would be nice if someone (with time on his/her side) could explore the exact reason of this "&" problem because this is a severe bug.

 

Greez

 

Mikeman

 

P.S.

@ Skittles

What are the exact "aspects of incompatibility of Ultimate SEO URLs and Update 060817" you are referring to?

I have got osc(060817) and "Ultimate SEO URLs - 2.1d (the original) and they seem to harmonize quite well.

(except the above issues -- but they already affected older versions)

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...