Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Independent SEO URL Validation


FWR Media

Recommended Posts

Independent SEO URL Validation

 

### This is not an Ultimate SEO URL package ###

Rather this is an addon to Chemos package requiring Chemos ULTIMATE SEO URLs to be installed.

 

Tested on:

MS2.2 - RC1 - RC2

Register globals On/Off

PHP4 - PHP5 - MySQL 4/5

Class version 2.1c - 2.1d - 2-2.2e

 

### Note: ##################################################

Development versions copied/pasted from the forums should be replaced with this version

##########################################################

 

What does it do?

 

A problem was identified with all versions of ULTIMATE SEO URLs that can have very negative results on indexing by search engines.

 

www.mysite.com/my-great-product-p-362.html ## Correct URL

Can be accessed by ...

 

www.mysite.com/myloadofabsoluterubbish-p-362.html ## Not so correct

 

or even just ..

 

www.mysite.com/-p-362.html ## Not so correct

 

The results are duplication penalties, sitemaps rejected the list goes on.

 

Version 2-2.2e attempted to address this but it is buggy and creates problems all of its own. Our recomendation is to use 2.1d (first 2.1d posted by yesudo 25 Nov 2006 ). This to our knowledge is the last version purely developed by Chemo and is very solid (Needs a few tweeks for strict MySQL5 and short_open_tag off).

 

301 Redirection:

Corrects bad links and 301 redirects to good link. (Good practice as Google will update its index acordingly)

 

404 Redirection:

404 redirects to index.php if the page no longer exists (e.g. a deleted category or product etc.).

 

This gives validation to earlier versions of ULTIMATE SEO URLS or replaces the validation function of the buggy 2-2.2e.

 

Simple installation:

 

Put a file in catalog root .. run it then delete it. Add one simple mod to application_top.php. Add a function to general.php. Turn it on in admin. Done!

 

Contribution address:

http://addons.oscommerce.com/info/5738

Edited by Babygurgles
Link to comment
Share on other sites

  • Replies 382
  • Created
  • Last Reply

Top Posters In This Topic

  • FWR Media

    150

My problem is where on earth you got these 'loadofabsoluterubbish-p-362.html' urls from? would google generates a load of 'rubbish ruls' to test yuor site? I would imagine if you supply, say, chemo's googlesitemaps then google would following them to index your site correctly.

or you got kicked by google if a visitor to your site manually key in some 'incorrect' urls ?

Ken

 

ps

I know my post might be irrelevant to this 'support thread' so feel free to delete if so.

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

My problem is where on earth you got these 'loadofabsoluterubbish-p-362.html' urls from? would google generates a load of 'rubbish ruls' to test yuor site? I would imagine if you supply, say, chemo's googlesitemaps then google would following them to index your site correctly.

or you got kicked by google if a visitor to your site manually key in some 'incorrect' urls ?

Ken

 

ps

I know my post might be irrelevant to this 'support thread' so feel free to delete if so.

 

Just as an example, you change the name of a product.

 

http://www.mysite.com/my-first-product-p-2.html

 

then after a name change ..

http://www.mysite.com/my-new-productname-p-2.html

 

Two functioning URLs pointing to the exact same page = SEO not good.

Edited by Babygurgles
Link to comment
Share on other sites

Im back :)

 

Ok i removed the REMOVE lines and VOILA

 

Warning: constant() [function.constant]: Couldn't find constant in /home/vmartpk/public_html/main/includes/application_top.php on line 301

 

 

Error!

 

Unable to determine the page link!

Link to comment
Share on other sites

If you got thousands of products and you change a handful of them. does it matter? and if you change a siginificant number of products (which would be odd), I think google webmaster tool would allow you to tell it to remove old urls from its index, if you bother.

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

Im back :)

 

Ok i removed the REMOVE lines and VOILA

 

Warning: constant() [function.constant]: Couldn't find constant in /home/vmartpk/public_html/main/includes/application_top.php on line 301

Error!

 

Unable to determine the page link!

 

 

Upgrade to the latest version please Pooya

Link to comment
Share on other sites

If you got thousands of products and you change a handful of them. does it matter? and if you change a siginificant number of products (which would be odd), I think google webmaster tool would allow you to tell it to remove old urls from its index, if you bother.

Ken

 

If you don't feel it's important Ken .. that's fine .. don't use it. I'd be grateful if you left this here.

Link to comment
Share on other sites

I've been thinking about this problem also for a while, and I too don't think it's particularly important.

Can anyone confirm that they have lost their SE rankings due to this problem?

 

Also, in a funny way, I kinda thought that when you make a product name change and the page it is still accessible by the old url that this is a good thing, especially if your product page is listed quite high. Am I wrong?

 

Finally, even Amazon have the same problem:

 

http://www.amazon.co.uk/Rough-Guide-Vietna...=pd_sim_b_img_2

http://www.amazon.co.uk/Lonely-Planet-Viet...=pd_sim_b_img_2

http://www.amazon.co.uk/Travel-Guides/dp/1...=pd_sim_b_img_2

http://www.amazon.co.uk/Travel/dp/18435361...=pd_sim_b_img_2

 

All point to the same page and so on. If its such a big problem why do they still have it? Maybe I am not comparing like with like?

 

What do you think?

 

Neil

Link to comment
Share on other sites

Where would the latest version be ? :rolleyes:

 

The first post in this thread just may be a good idea .. Pooya I'm "this close" (describes a millimeter) to ignoring your posts!

Edited by Babygurgles
Link to comment
Share on other sites

I've been thinking about this problem also for a while, and I too don't think it's particularly important.

Can anyone confirm that they have lost their SE rankings due to this problem?

 

Also, in a funny way, I kinda thought that when you make a product name change and the page it is still accessible by the old url that this is a good thing, especially if your product page is listed quite high. Am I wrong?

 

Finally, even Amazon have the same problem:

 

http://www.amazon.co.uk/Rough-Guide-Vietna...=pd_sim_b_img_2

http://www.amazon.co.uk/Lonely-Planet-Viet...=pd_sim_b_img_2

http://www.amazon.co.uk/Travel-Guides/dp/1...=pd_sim_b_img_2

http://www.amazon.co.uk/Travel/dp/18435361...=pd_sim_b_img_2

 

All point to the same page and so on. If its such a big problem why do they still have it? Maybe I am not comparing like with like?

 

What do you think?

 

Neil

 

I have a site I built that uses version 2.1d. This site was doing very good in google search engine, was coming up in the top 3 listings for a few keywords. Then BAM! The mother Fuusjcjc crashed big time. It still does good in msn and yahoo, but is way back in google.

 

As for amazon, they dont have much to worry about, they have become a common name and have advertising in more places than just the internet.

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

I'm having a bit of trouble with this mod. I don't necessarily think there is anything wrong with the contribution, but it does cause a serious issue with my store. As soon as I enable the mod in admin, and then visit any page with a rewritten URL, I get this:

 

Error!

 

Unable to determine the page link!

 

And nothing else on the page. A google search revealed a few posts on various messages boards, and they all said to disable "Use Search-Engine Safe URLs" in admin, which it is and always has been. With your mod disabled, everything appears to work fine, as it has been. I have also tried resetting the SEO URL's cache. I am using Ultimate SEO URL's 2.1d dated Nov 25 2006. I am also running RC2a, PHP 5.2.5, Apache 2.2.8, and MySQL 5.0.51a. I'm sure it's something I did wrong or a problem with my store, but I don't know where to look.

Link to comment
Share on other sites

I'm having a bit of trouble with this mod. I don't necessarily think there is anything wrong with the contribution, but it does cause a serious issue with my store. As soon as I enable the mod in admin, and then visit any page with a rewritten URL, I get this:

And nothing else on the page. A google search revealed a few posts on various messages boards, and they all said to disable "Use Search-Engine Safe URLs" in admin, which it is and always has been. With your mod disabled, everything appears to work fine, as it has been. I have also tried resetting the SEO URL's cache. I am using Ultimate SEO URL's 2.1d dated Nov 25 2006. I am also running RC2a, PHP 5.2.5, Apache 2.2.8, and MySQL 5.0.51a. I'm sure it's something I did wrong or a problem with my store, but I don't know where to look.

 

 

Is that the full error message as it's not very informative?

Link to comment
Share on other sites

Ok, I did a little more digging. I'm running Windows Server 2003 and I log all PHP errors in the event log. Whenever I get the unable to determine page link error, this shows up in the logs:

 

PHP Warning: constant() [<a href='function.constant'>function.constant</a>]: Couldn't find constant in D:\wwwroot\mydomain.com\includes\functions\general.php on line 1402.

 

Line 1402 in general.php is this:

 

$linkreturned = tep_href_link(constant(strtoupper($validate_array[0])), $validate_array[1]); // Get a propper new SEO link

 

Which is obviously from your mod. My tep_href_link() function in html_output.php looks like this:

 

////
// The HTML href link wrapper function
 function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
  global $seo_urls;
  if (!is_object($seo_urls)) {
	  if (!class_exists('SEO_URL')) {
		  include_once(DIR_WS_CLASSES . 'seo.class.php');
	  }
	  global $languages_id;
	  $seo_urls = new SEO_URL($languages_id);
  }
  return $seo_urls->href_link($page, $parameters, $connection, $add_session_id);
 }

Link to comment
Share on other sites

Ok, I did a little more digging. I'm running Windows Server 2003 and I log all PHP errors in the event log. Whenever I get the unable to determine page link error, this shows up in the logs:

Line 1402 in general.php is this:

 

$linkreturned = tep_href_link(constant(strtoupper($validate_array[0])), $validate_array[1]); // Get a propper new SEO link

 

Which is obviously from your mod. My tep_href_link() function in html_output.php looks like this:

 

////
// The HTML href link wrapper function
 function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
  global $seo_urls;
  if (!is_object($seo_urls)) {
	  if (!class_exists('SEO_URL')) {
		  include_once(DIR_WS_CLASSES . 'seo.class.php');
	  }
	  global $languages_id;
	  $seo_urls = new SEO_URL($languages_id);
  }
  return $seo_urls->href_link($page, $parameters, $connection, $add_session_id);
 }

 

I have not tested nor developed on windows servers and I know that chemos mod needs to be taken way back to support windows.

 

I'm sorry but I can't help with a windows installation.

Link to comment
Share on other sites

I have not tested nor developed on windows servers and I know that chemos mod needs to be taken way back to support windows.

 

I'm sorry but I can't help with a windows installation.

 

I know chemos mod works on Windows at least up to version 2.1d. I have not tried any newer versions. My problem seems to be with the use of constant(). I've never used it before, but I did find this:

 

http://us.php.net/constant

 

If the constant does not exist, constant() will generate a warning and return null.

 

I will see if I can work something out and let you know how it goes.

Link to comment
Share on other sites

I know chemos mod works on Windows at least up to version 2.1d. I have not tried any newer versions. My problem seems to be with the use of constant(). I've never used it before, but I did find this:

 

http://us.php.net/constant

I will see if I can work something out and let you know how it goes.

 

Ok thanks.

 

constant(strtoupper($validate_array[0]))

 

is effectively saying ..

 

constant(FILENAME_DEFAULT)

 

or

 

constant(FILENAME_PRODUCT_INFO)

 

If I was writing it without variable it would be ..

 

constant("FILENAME_PRODUCT_INFO") note the ""

Link to comment
Share on other sites

Ok, I'm a dumbass. The problem is definetly with my site and has nothing to do with your code or even Ultimate SEO URLs. I found your other thread and decided to put in that debugging code you listed and check it's output. Here's an example of what I got:

 

$validate_array[0] = FILENAME_PRODUCT_INFO

$validate_array[1] = products_id=686

$querytype = filename_product_info-products_id=686

$_SERVER['REQUEST_URI'] = /tornadopower-central-vacuum-maintenance-cloths-p-686.html

 

Took out the debugging code, and BAM, starts working again. Turns out when I was testing before I was on category pages, not individual product pages. Product pages work with your mod, categories blow up. Then I realized, I am not using Ultimate SEO URLs on the categories. The guy that worked on this site before me didn't like the way it wrote URLs, so he came up with his own deal. He basically created static HTML files in the root named exactly how he wanted the URLs to look. For instance, there is a file in the root called electric-hoses.html. Inside that file is the following:

 

<?php
$_GET['cPath'] = "5_32";
$category_current_url = basename($_SERVER['PHP_SELF']);
include('index.php');
?>

 

That code chokes when using your mod. I could easily revert back to using USEO for categories, but all my categories are already indexed in Google and I don't want to mess with it.

 

I need to learn to think a little more before posting, lol. :P

Edited by i960
Link to comment
Share on other sites

This is for Links Manager

 

 

I had this error in my links page when I would click on a link category:

 

Warning: constant() [function.constant]: Couldn't find constant in /home/blablabla/includes/functions/general.php on line 8462

Error!

Unable to determine the page link!

 

Its an easy fix though.

 

in the code that goes into includes/functions/general.php

find:

 

( strpos($_SERVER['REQUEST_URI'], '-i-') ? ($querytype = 'filename_information-info_id=' . $HTTP_GET_VARS['info_id']) :

 

Add under:

 

( strpos($_SERVER['REQUEST_URI'], '-links-') ? ($querytype = 'filename_links-lPath=' . $HTTP_GET_VARS['lPath']) :

 

Then under that where it has:

 

false ))))))))) );

 

Add 1 more ) so its:

 

false )))))))))) );

 

Thats it!

Ive tested products, categories, articles, articles_info, info_pages, manufactures, and now links.

Works Fantastic! Thank you Babygurgles. This is going to help a lot. Whether some people believe it or not. I never even realized my urls were GARBAGE untill the other day when I was reading your post.

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

Hello

 

I installed Ultimate SEO URLs 2.2.2e FIXED Full Package.

 

Then i installed Independent SEO URL Validation(for ULTIMATE SEO URLs) (Babygurles)

 

But i'm still having a problem with the "next page" (example: http://www.baby-lux.com/eshop/bebe-confort-m-6.html)

it is not working...

 

Can someone (Babygurgles) please help me? I have done a lot of reading on this form but haven't found a fix yet...

 

Thx in advance!

 

edit: i just tested a link to an external site and it's not working either... example

Edited by Flexwebbe
Link to comment
Share on other sites

I fixed my problem. All I had to do was change this line in application_top.php from this:

 

if ( is_object($seo_urls) && (strpos($_SERVER['REQUEST_URI'], '.html') !== false) && (defined('FWR_VALIDATION_ON') && FWR_VALIDATION_ON === 'true') ) { // SEO URLS is active and there is .html in the querystring

 

To this:

 

if ( is_object($seo_urls) && (strpos($_SERVER['REQUEST_URI'], '-p-') !== false) && (strpos($_SERVER['REQUEST_URI'], '.html') !== false) && (defined('FWR_VALIDATION_ON') && FWR_VALIDATION_ON === 'true') ) { // SEO URLS is active and there is .html in the querystring

 

Now this code will really only work in my case and it's probably not ideal. The only SEO URL's I have are the one's with -p- in them. I do not have any of the other ones. So my change makes sure that the validation code only works for URL's with -p- and .html in them. If anyone has a site where they have some static html URL's that were not written by Ultimate SEO URL's, then some form of my code might work for you too. Maybe it can be written to test for all the various forms of SEO URL's instead of just testing if it ends in HTML. Hope this helps someone.

Edited by i960
Link to comment
Share on other sites

Hello

 

I installed Ultimate SEO URLs 2.2.2e FIXED Full Package.

 

Then i installed Independent SEO URL Validation(for ULTIMATE SEO URLs) (Babygurles)

 

But i'm still having a problem with the "next page" (example: http://www.baby-lux.com/eshop/bebe-confort-m-6.html)

it is not working...

 

Can someone (Babygurgles) please help me? I have done a lot of reading on this form but haven't found a fix yet...

 

Thx in advance!

 

edit: i just tested a link to an external site and it's not working either... example

 

The links to external sites are working, but i'm still having the 'next page' problem... (pulling my hair out :))

Link to comment
Share on other sites

found a typo:

 

In the code for includes/functions/general/

 

find:

 

( strpos($_SERVER['REQUEST_URI'], '-t-') ? ($querytype = 'filename_articles-tPath=' . $HTTP_GET_VARS['pID']) :

 

replace with:

 

( strpos($_SERVER['REQUEST_URI'], '-t-') ? ($querytype = 'filename_articles-tPath=' . $HTTP_GET_VARS['tPath']) :

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

Hi,

 

Just tried to install the SQL using the validation_installer.php and it just sends me back to the index page of the site? Any help would be cool. I checked to see if it installed anything and it did not.

 

Anyway any help would be great.

 

PS: Not sure why people have posted that this is not useful. This is a very important feature and could also prevent your competitors from sinking you! All they have to do is spread a faulty links all over and google will slap your site with a duplicate content filter and your rankings for your site will sink. Also other people talking about your site may miss spell the url and it would be possible for duplicate content ban. So this is VERY important!

 

Thanks,

Jamie

Edited by john2323
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...