Jump to content
Sign in to follow this  
FWR Media

[Contribution] Independent SEO URL Validation

Recommended Posts

 

Right, I'm saying I tried that and didn't have any luck. Did you see the code I posted? I have tried several variations of that including the one posted in the post you mention - sorry I thought I made that clear. Do you have any other suggestions for debugging this? Why would the include of that program not work here?

 

Thanks again for your help.

Share this post


Link to post
Share on other sites
lets say you have a url like ..

 

http://www.mysite.com/my-great-product-p-12.html

 

Try in your browser (find a real url to try with this not the above example) ..

 

http://www.mysite.com/-p-12.html - if it redirects to the real url it is working

 

also try ..

 

http://www.mysite.com/absolute-rubbish-p-12.html

 

If it redirects to the real url it is working.

 

Lastly try ..

 

http://www.mysite.com/my-great-product-p-9999.html

 

If you get a 404 page not found it's working.

 

I've loaded this contribution (2.1d original by you) but wasn 't able to do step #3 (I couldn't find the exact text to replace)

However I've tested my site as you suggested above and all works except for the last one.

Any suggestions?

You can look at www.rockprettybaby.ca

Thanks in advance

Share this post


Link to post
Share on other sites

After changing around some of the categories I am having a duplicate content problem with Google. Does this contribution work with categories?

 

Thanks for this great contribution!

 

This contribution is correctly redirecting the products, but the categories aren't working right.

 

 

For example:

 

http://www.myurl.com/catname-c-228_1761.html

 

and

 

http://www.myurl.com/catname-c-952_1715_1739_1740_1761.html

 

 

are exactly the same page.

 

If I browse to http://www.myurl.com/wrongcatname-c-228_1761.html it will redirect me to http://www.myurl.com/catname-c-228_1761.html, but it does not readjust the category numbers.

 

Is this a problem with the way I installed the contribution, or does the contribution not redirect you to the proper category numbers?

Share this post


Link to post
Share on other sites

OK, the bug only appeared when you were more than 2 categories deep.

 

 

http://www.myurl.com/catname-c-227_1761.html

would redirect to

http://www.myurl.com/catname-c-228_1761.html

 

but

 

http://www.myurl.com/catname-c-951_1715_1739_1740_1761.html

would not redirect to:

http://www.myurl.com/catname-c-952_1715_1739_1740_1761.html

 

 

I made the following changes (hacks) to my store:

 

In application_top.php I replaced

// calculate category path
 if (isset($HTTP_GET_VARS['cPath'])) {
$cPath = $HTTP_GET_VARS['cPath'];
 } elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) {
$cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);
 } else {
$cPath = '';
 }

 

// calculate category path
// BOE Category validation
if (!(isset($cPath))) {
// EOE Category validation
 if (isset($HTTP_GET_VARS['cPath'])) {
$cPath = $HTTP_GET_VARS['cPath'];
 } elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) {
$cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);
 } else {
$cPath = '';
 }
// BOE Category validation  
}
// EOE Category validation

 

 

and in general.php I replaced

( strpos($_SERVER['REQUEST_URI'], '-p-') ? ($querytype = 'filename_product_info-products_id=' . $get_id_vars) :
( strpos($_SERVER['REQUEST_URI'], '-c-') ? ($querytype = 'filename_default-cPath=' . $HTTP_GET_VARS['cPath']) :
( strpos($_SERVER['REQUEST_URI'], '-m-') ? ($querytype = 'filename_default-manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']) :
( strpos($_SERVER['REQUEST_URI'], '-pi-') ? ($querytype = 'filename_popup_image-pID=' . $HTTP_GET_VARS['pID']) :
( strpos($_SERVER['REQUEST_URI'], '-t-') ? ($querytype = 'filename_articles-tPath=' . $HTTP_GET_VARS['tPath']) :
( strpos($_SERVER['REQUEST_URI'], '-a-') ? ($querytype = 'filename_article_info-articles_id=' . $HTTP_GET_VARS['articles_id']) :
( strpos($_SERVER['REQUEST_URI'], '-pr-') ? ($querytype = 'filename_product_reviews-products_id=' . $get_id_vars) :
( strpos($_SERVER['REQUEST_URI'], '-pri-') ? ($querytype = 'filename_product_reviews_info-products_id=' . $get_id_vars) :
( strpos($_SERVER['REQUEST_URI'], '-prw-') ? ($querytype = 'filename_product_reviews_write-products_id=' . $get_id_vars) :
( strpos($_SERVER['REQUEST_URI'], '-i-') ? ($querytype = 'filename_information-info_id=' . $HTTP_GET_VARS['info_id']) :
( strpos($_SERVER['REQUEST_URI'], '-links-') ? ($querytype = 'filename_links-lPath=' . $HTTP_GET_VARS['lPath']) :
$do_validation = false )))))))))) );

 

with

 

// BOE Category validation
 if (isset($HTTP_GET_VARS['cPath'])) {
$cPathVar = $HTTP_GET_VARS['cPath'];
$bottom_cat = array_pop(tep_parse_category_path($cPathVar));


  $parent_categories_query = tep_db_query("select parent_id, categories_id from " . TABLE_CATEGORIES . " where categories_id = '" . $bottom_cat . "'");
  while ($parent_categories = tep_db_fetch_array($parent_categories_query)) {
  if ($parent_categories['parent_id'] == '0') { 
  $cPath = $parent_categories['categories_id'];
  } else {
		$categories = array($bottom_cat);
		tep_get_parent_categories($categories, $bottom_cat);

		$categories = array_reverse($categories);

		$cPath = implode('_', $categories);
  }
  }
  }
( strpos($_SERVER['REQUEST_URI'], '-p-') ? ($querytype = 'filename_product_info-products_id=' . $get_id_vars) :
( strpos($_SERVER['REQUEST_URI'], '-c-') ? ($querytype = 'filename_default-cPath=' . $cPath) :
( strpos($_SERVER['REQUEST_URI'], '-m-') ? ($querytype = 'filename_default-manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']) :
( strpos($_SERVER['REQUEST_URI'], '-pi-') ? ($querytype = 'filename_popup_image-pID=' . $HTTP_GET_VARS['pID']) :
( strpos($_SERVER['REQUEST_URI'], '-t-') ? ($querytype = 'filename_articles-tPath=' . $HTTP_GET_VARS['tPath']) :
( strpos($_SERVER['REQUEST_URI'], '-a-') ? ($querytype = 'filename_article_info-articles_id=' . $HTTP_GET_VARS['articles_id']) :
( strpos($_SERVER['REQUEST_URI'], '-pr-') ? ($querytype = 'filename_product_reviews-products_id=' . $get_id_vars) :
( strpos($_SERVER['REQUEST_URI'], '-pri-') ? ($querytype = 'filename_product_reviews_info-products_id=' . $get_id_vars) :
( strpos($_SERVER['REQUEST_URI'], '-prw-') ? ($querytype = 'filename_product_reviews_write-products_id=' . $get_id_vars) :
( strpos($_SERVER['REQUEST_URI'], '-i-') ? ($querytype = 'filename_information-info_id=' . $HTTP_GET_VARS['info_id']) :
( strpos($_SERVER['REQUEST_URI'], '-links-') ? ($querytype = 'filename_links-lPath=' . $HTTP_GET_VARS['lPath']) :
$do_validation = false )))))))))) );
// EOE Category validation

Edited by rs2k

Share this post


Link to post
Share on other sites
This is the solution :

 

function four_o_four_die() { // 404 then redirect doesn't work as Google records a 302 so we need to die here with a 404
echo
header("HTTP/1.0 404 Not Found") .
include(HTTP_SERVER . DIR_WS_HTTP_CATALOG . 'http_error.php?error_id=404');
exit;
}

for example if you have a customised http error page.

 

Didier.

 

Do you mean, to replace the following on general.php with it?

 

function four_o_four_die() { // 404 then redirect doesn't work as Google records a 302 so we need to die here with a 404

echo

header("HTTP/1.0 404 Not Found") .

'<p align="left" style="font-size: large;">  404 Page not found!</p>

<div align="center" style="width: 100%; margin-top: 70px;">

<div align="center" style="font-family: verdana; font-size: 0.8em; color: #818181; padding: 90px 10px 90px 10px; width: 60%; border: 1px solid #818181;">

This product/category does not exist it may have been deleted.<p />

To return to ' . STORE_NAME .

'. Please click here <a href="' . tep_href_link(FILENAME_DEFAULT) . '" title="' . STORE_NAME . '">back to ' . STORE_NAME . '</a>

</div></div>';

}

 

Because I did that and got a blank page as a result. I would like the error page to be my custom 404 page. Not sure what to do here... :blush:

Any help would be greatly appreciated. This contribution is fantastic!

 

Yol

Edited by jailaxmi

I repeat myself when under stress, I repeat myself when under stress, I repeat myself...

 

--King Crimson (“Discipline”)

Share this post


Link to post
Share on other sites

Hi,

 

Tis contribution is great in several cases, but in other I dont knov if it is only my problem or general problem...

 

Look this

 

gogle found not found errors

variation of pages like this

If I try to open it I get explorer error 404...

/-m-.html

(453 is not in cataloq) this variation is ok, and it opens 404 page of validation contrib

/-m-453.html

 

But c (categories) are vorking properly -> it opens 404 page of Independent SEO URL Validation

/-c-.html

 

Anyone elese noticed this problem?

Share this post


Link to post
Share on other sites
Hi,

 

Tis contribution is great in several cases, but in other I dont knov if it is only my problem or general problem...

 

Look this

 

gogle found not found errors

variation of pages like this

If I try to open it I get explorer error 404...

/-m-.html

(453 is not in cataloq) this variation is ok, and it opens 404 page of validation contrib

/-m-453.html

 

But c (categories) are vorking properly -> it opens 404 page of Independent SEO URL Validation

/-c-.html

 

Anyone elese noticed this problem?

 

Which version of Ultimate seo urls are you using? Those urls are not being correctly constructed. (if you are showing the full urls)

Share this post


Link to post
Share on other sites

I use the lates version of this contribution

 

links tah google found errors are like

 

/-m-.html?filter_id=32&sort=2a

/-m-.html?osCsid=06493d8e3705a1527d56026f41d2e7e8&currency=GBP

/-m-.html?sort=2a

 

and I get even this kind of links

/index.php?currency=SIT&manufacturers_id=&osCsid=c4b1b0c6812401b8fd423bfe6fcd5573

 

I don't know from where did google got this links....

 

 

yesterday I added http://www.oscommerce.com/community/contributions,2819

so I will have less problems with &osCsid

 

should I yout add /-m-.html to robots.txt?

 

do yo know why link /-c-.html put out 404 page and /-m-.html, /-a-.html and others it dosent(only explorer 404)? I know these links are not valid... But it should work, right?

Share this post


Link to post
Share on other sites

I want to use your contribution, but I have the following problem:

I don't use ".html" in my ultimate seo contribution, but just nothing.

An URL for my products looks like this: http://www.mysite.com/sometext-p-1

 

I already changed your code for application_top, so it won't ask for

 

&& (strpos($_SERVER['REQUEST_URI'], '.html') !== false)

 

I still have a problem in this part of the code:

...
case(false !== strpos($qs_parts[$i], '.html')):
$core = urldecode($qs_parts[$i]); // Found the path
( (strstr($core, '{') !== false) ? ($core = str_replace(strstr($core, '{'), '', $core) . '.html') : NULL ); // Remove attributes
break;
...

 

Can you please tell me, how this part of the code should change?

Thanks for a reply.

Share this post


Link to post
Share on other sites
I want to use your contribution, but I have the following problem:

I don't use ".html" in my ultimate seo contribution, but just nothing.

An URL for my products looks like this: http://www.mysite.com/sometext-p-1

 

I already changed your code for application_top, so it won't ask for

 

&& (strpos($_SERVER['REQUEST_URI'], '.html') !== false)

 

I still have a problem in this part of the code:

...
case(false !== strpos($qs_parts[$i], '.html')):
$core = urldecode($qs_parts[$i]); // Found the path
( (strstr($core, '{') !== false) ? ($core = str_replace(strstr($core, '{'), '', $core) . '.html') : NULL ); // Remove attributes
break;
...

 

Can you please tell me, how this part of the code should change?

Thanks for a reply.

 

The contribution was designed to be used by standard seo urls function.

 

What you are asking for is custom coding which is outside of the bounds of this support thread.

Edited by FWR Media

Share this post


Link to post
Share on other sites

hi everybody,

i have the same problem like Glcustoms

 

i have installed Ultimate_SEO_URLSv21d_UPDATED-07-NOV-2008(+url validation) and Information Pages Unlimited v2.05

but i'm getting the links in this way http://mysite/shop/-i-2.html

 

also have article contrib installed and everything is ok there.

if i disable ultimate seo the Information Pages Unlimited works fine.

 

i don't know where to look at.

 

any help will be appreciate

Share this post


Link to post
Share on other sites
and one more problem...just noticed the 404 header doesn't work for me. if i change the url to

 

http://mysite.com//my-great-product-c-99999.html

 

it just goest to "The webpage cannot be found" and not the 404 header from the contribution.

 

any ideas??

 

thank you

best, venz

 

That would mean that validation is not installed correctly .. all validation does is take the incoming url .. if it is an seo url it asks the seo url class for a fresh url .. if the two don't match it 301 redirects it .. if it doesn't exist it gives 404.

 

In your example it does nothing which can't happen.

Share this post


Link to post
Share on other sites
That would mean that validation is not installed correctly .. all validation does is take the incoming url .. if it is an seo url it asks the seo url class for a fresh url .. if the two don't match it 301 redirects it .. if it doesn't exist it gives 404.

 

In your example it does nothing which can't happen.

 

ok...everything seems to be installed correct. and now i noticed 404 works fine with firefox and doesn't work with ie7

Share this post


Link to post
Share on other sites

I've just found this contribution and installed it to test.

 

The thinking behind the contribution is good because the 404 redirects to index.php and also the 301 corrections are a great addition but the only flaw I see with the original ULTIMATE SEO URL contribution from chemo and this very useful add-on is that there is a danger of abuse

 

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

 

So by adding this add-on www.mysite.com/myloadofabsoluterubbish-p-362.html will automatically become www.mysite.com/my-great-product-p-362.html in the browser and that is a good thing but what happens if someone maliciously adds links on their website to yours and show the link as: www.mysite.com/dont-trust-this-site-it-is-a-fraud-p-362.html

 

I tried playing around with the code to show a 'page not found' if someone tries to abuse the SEO URLs but haven't had much joy. I know the -p-362.html is the key to arriving on a particular product page and what preceeds it is irrelavant as the URL will still direct there but I am trying to find a way to show those pages as a custom designed 'page not found'.

 

Any tips in the right direction would be appreciated.


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

Share this post


Link to post
Share on other sites
I've just found this contribution and installed it to test.

 

The thinking behind the contribution is good because the 404 redirects to index.php and also the 301 corrections are a great addition but the only flaw I see with the original ULTIMATE SEO URL contribution from chemo and this very useful add-on is that there is a danger of abuse

 

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

 

So by adding this add-on www.mysite.com/myloadofabsoluterubbish-p-362.html will automatically become www.mysite.com/my-great-product-p-362.html in the browser and that is a good thing but what happens if someone maliciously adds links on their website to yours and show the link as: www.mysite.com/dont-trust-this-site-it-is-a-fraud-p-362.html

 

I tried playing around with the code to show a 'page not found' if someone tries to abuse the SEO URLs but haven't had much joy. I know the -p-362.html is the key to arriving on a particular product page and what preceeds it is irrelavant as the URL will still direct there but I am trying to find a way to show those pages as a custom designed 'page not found'.

 

Any tips in the right direction would be appreciated.

 

Yep

 

The difficulty is that the contribution fundamentally exists because shop owners relatively regularly change the name of a product and or categories, although you can ofc simply reset the cache, this does not help with the already indexed pages

which need to have a 301 redirect in place.

 

To try to differentiate between valid reasons for a 301 and that of possible abuse is to my mind impossible.

 

What harm would www.mysite.com/dont-trust-this-site-it-is-a-fraud-p-362.html do anyway? Google tries the link .. google realises it is a 301 redirect .. Google does not index the 301 link.

Share this post


Link to post
Share on other sites
What harm would www.mysite.com/dont-trust-this-site-it-is-a-fraud-p-362.html do anyway? Google tries the link .. google realises it is a 301 redirect .. Google does not index the 301 link.

 

What about pages that Google has indexed that don't really exist and return a 404 error? I have always wondered how that could be possible, but when I check with the google webmaster tools there are a lot of indexed pages that are supposedly part of one of my sites (not run by OSCommerce, but a regular html site), but in reality aren't. If I click on the indexed links I get a 404 message, but they are indexed anyway. Any thoughts on this (although it is not related to this thread)?

 

Thanks.


I repeat myself when under stress, I repeat myself when under stress, I repeat myself...

 

--King Crimson (“Discipline”)

Share this post


Link to post
Share on other sites
What about pages that Google has indexed that don't really exist and return a 404 error? I have always wondered how that could be possible, but when I check with the google webmaster tools there are a lot of indexed pages that are supposedly part of one of my sites (not run by OSCommerce, but a regular html site), but in reality aren't. If I click on the indexed links I get a 404 message, but they are indexed anyway. Any thoughts on this (although it is not related to this thread)?

 

Thanks.

 

A 404 message and 404 headers are different things. Are you sure they deliver 404 headers.

 

And please don't carry this on here as you are correct .. your question is not related and will make it hard for those with real seo urls issues to find their solutions.

Share this post


Link to post
Share on other sites
Yep

 

The difficulty is that the contribution fundamentally exists because shop owners relatively regularly change the name of a product and or categories, although you can ofc simply reset the cache, this does not help with the already indexed pages

which need to have a 301 redirect in place.

 

To try to differentiate between valid reasons for a 301 and that of possible abuse is to my mind impossible.

 

What harm would www.mysite.com/dont-trust-this-site-it-is-a-fraud-p-362.html do anyway? Google tries the link .. google realises it is a 301 redirect .. Google does not index the 301 link.

 

I think there is a potential for abuse, the harm (if there is any) can only be evaluated if abused links are placed online and if people decide not to click them or if it turns in to a public relations disaster.

 

I am inclined to agree with you that what I was thinking about is impossible to achieve but maybe I'll still try fiddling around with the code for a few days.


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

Share this post


Link to post
Share on other sites
I think there is a potential for abuse, the harm (if there is any) can only be evaluated if abused links are placed online and if people decide not to click them or if it turns in to a public relations disaster.

 

I am inclined to agree with you that what I was thinking about is impossible to achieve but maybe I'll still try fiddling around with the code for a few days.

 

Be sure to let me know if your "fiddling" achieves anything please Mr Chooch

Share this post


Link to post
Share on other sites

Hi!

 

Thanks for the contribution!

 

I installed it and it works fine. The only problem I have is that if I turn the validation on, I can't use my Buy Button from the category page. For example I klick the link "Hardware (cP=1) in the menu, I get to the page where the subcats are listed and below the box with "new products" in the hardware catgeory.

 

If I klick Buy Now from the box, I come to the shopping cart site, but nothing is in the cart added.

 

If I turn Validation off in admin, everything works fine, so I think, there is a small problem with the contribution.

 

I use Ultimate SEO, Header Tags SEO, SID KILLER, Product Listing Enhancements (it comes with the following bugfix, which I installed, because I had way more problems without it)

 

3. If  search engine friendly url is set to 'on' you can get a 'Unable to determine the page link' error, this is because $PHP_SELF can  become a null value as due to the altered search engine friendly url causing $HTTP_SERVER_VARS['PHP_SELF'] to give the same result as getenv('PATH_INFO') and the search engine friendly urls function removes getenv('PATH_INFO') from $PHP_SELF so $PHP_SELF = NULL hence error.

To fix, in application_top.php 
find (94)
$PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF);
add after:
if (($PHP_SELF == '') || (strlen(trim($PHP_SELF)) == 0)) $PHP_SELF = rtrim(str_replace(array( getenv('PATH_INFO'),getenv('QUERY_STRING')) , '', $_SERVER['REQUEST_URI']), '?');

4. An additional issue with search engine friendly url is set to 'on' is some or all of the $_GET not being set.

To fix, in application_top.php

find (96)

  $vars = explode('/', substr(getenv('PATH_INFO'), 1));

add after:

if (PHP_VERSION >= 4.1) $HTTP_GET_VARS =& $_GET;

 

EDIT: I tried without the bugfix, but the problem is still the same. Only if I turn Validation on, I get the problem in category listing.

Edited by Hunnenkoenig

Share this post


Link to post
Share on other sites

hi

 

install Ultimate SEO URLs v2 and install Independent SEO URL Validation

my store used arabic language

URL look

my-URL%20copy.gif

help me

Share this post


Link to post
Share on other sites
hi

 

install Ultimate SEO URLs v2 and install Independent SEO URL Validation

my store used arabic language

URL look

my-URL%20copy.gif

help me

 

This is more an seo urls post than a validation post. In SEO URLs admin you need to set up character replacements .. you cannot use special language characters in urls.

Share this post


Link to post
Share on other sites

thank you for fast reply

The format MUST be in the form: char=>conv,char2=>conv2 but how can conversions to Arabic language wait for reply

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×