Jump to content
Sign in to follow this  
FWR Media

ULTIMATE SEO URLs avoid google penalties

Recommended Posts

Just did this and got this error

 

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

 

 

Error!

 

Unable to determine the page link!

 

 

????

 

Turned seo off working again.

Share this post


Link to post
Share on other sites
Just did this and got this error

 

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

Error!

 

Unable to determine the page link!

????

 

Turned seo off working again.

 

 

Give an example below of one of your SEO URLs please.

 

It looks to me like your URLs don't have the standard -c- -p- -m- etc. seperators.

Edited by Babygurgles

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

if seo url off and the site works, then nothing wrong with application_top.php. I would first look at the configuration - my store - use user friendly urls, which must be off or false.

Ken

 

Just did this and got this error

 

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

 

 

Error!

 

Unable to determine the page link!

 

 

????

 

Turned seo off working again.


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.

Share this post


Link to post
Share on other sites

sorry did not realise this is a different thread and you may be using something different from chemo seo urls so my post above may not apply.

Ken

if seo url off and the site works, then nothing wrong with application_top.php. I would first look at the configuration - my store - use user friendly urls, which must be off or false.

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.

Share this post


Link to post
Share on other sites
Instuctions attached.

 

hey babygurles

 

this update fixed one of my problem, the one when you can edit URL and it sets in category till you goto cataog/index.php

Share this post


Link to post
Share on other sites
hey babygurles

 

this update fixed one of my problem, the one when you can edit URL and it sets in category till you goto cataog/index.php

 

Yes there were some pathing issues.

 

I would now call this a beta though .. If anyone uses this please report back .. obviously it'd be nice to hear good stuff but I especially need to know if you encounter any issues.

Edited by Babygurgles

Share this post


Link to post
Share on other sites

Errr i got to many members on my site :(

 

Will open it in a while.... But this error comes only when i open seo :(

Share this post


Link to post
Share on other sites
Errr i got to many members on my site :(

 

Will open it in a while.... But this error comes only when i open seo :(

 

I think you are talking about the seo function in admin, the one that says "still in development". This is about ULTIMATE SEO URLs.

Share this post


Link to post
Share on other sites
hey babygurles

 

this update fixed one of my problem, the one when you can edit URL and it sets in category till you goto cataog/index.php

 

 

i done some more test, it aint fixed my problem but its made it little better then before

Share this post


Link to post
Share on other sites
i done some more test, it aint fixed my problem but its made it little better then before

 

nono_uk you have a problem with your install of sEO URLS .. NOT with this mod.

 

This post is about THIS mod.

Share this post


Link to post
Share on other sites

Well I've packaged it now with auto install admin settings (turn URL validation on/off).

 

But I want some more feedback before I think of putting it up as an active contribution.

 

The package is attached I'll delete the old one.

Share this post


Link to post
Share on other sites

Example of link http://www.vmart.pk/main/mobile-phones-c-100.html

 

Btw this is happening to all the category and product pages.

 

The error

 

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


Error!

Unable to determine the page link!

Edited by Pooya

Share this post


Link to post
Share on other sites
Example of link http://www.vmart.pk/main/mobile-phones-c-100.html

 

Btw this is happening to all the category and product pages.

 

The error

 

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

Unable to determine the page link!

 

Have you hardcoded all your filenames or something? for example what happens if you put in header.php

 

<?php

echo FILENAME_DEFAULT . '<br />';

?>

Share this post


Link to post
Share on other sites
Well I've packaged it now with auto install admin settings (turn URL validation on/off).

 

But I want some more feedback before I think of putting it up as an active contribution.

 

The package is attached I'll delete the old one.

 

I'm having an issue with adding duplicate products to the shopping basket. The first product gets added correctly but if you click on the product in the basket, the product info page appears as expected but when you try to add it to the basket again everything in the basket is deleted.

 

I'm still able to add any string to get to the products e.g.

 

http://www.teetreedesigns.co.uk/anyoldrubbish-p-111.html

 

Gives the same as:

 

http://www.teetreedesigns.co.uk/yodafone-p-111.html

 

You can try this on any product at www.teetreedesigns.co.uk

 

This site is running version 2-2.2e

 

My application top code is

// Ultimate SEO URLs v2.1
 if ((!defined(SEO_ENABLED)) || (SEO_ENABLED == 'true')) {
include_once(DIR_WS_CLASSES . 'seo.class.php');
if ( !is_object($seo_urls) ){
  $seo_urls = new SEO_URL($languages_id);
}
	################################################
// fwrmedia.co.uk mod to check SEO link validity
if ( is_object($seo_urls) && strpos($_SERVER['REQUEST_URI'], '.html') ) { // SEO URLS is active and there is .html in the querystring
  tep_validate_seo_urls();
}
################################################
// END fwrmedia.co.uk mod to check SEO link validity
 }

 

My validation function code is

 

function tep_validate_seo_urls() {
global $HTTP_GET_VARS;
################################################
// fwrmedia.co.uk mod to check SEO link validity
$querystring = str_replace('?', '&', $_SERVER['REQUEST_URI']);
$qs_parts = explode('&', $querystring); // explode the querystring into an array
$count = count($qs_parts);
$added_uri = array();
$remove_nasties = array('%3C', '%3E', '<', '>', ':/', 'http', 'HTTP'); // We do tep_sanitize_string() later anyway
for ( $i=0; $i<$count; $i++ ) { // We don't want to introduce vulnerability do we :)
 switch($qs_parts[$i]) {
 case(false !== strpos($qs_parts[$i], '.html')):
 $core = $qs_parts[$i]; // Found the path
 break;
 case(false !== strpos($qs_parts[$i], 'osCsid')):
 $seo_sid = $qs_parts[$i]; // Found the osCsid
 break;
 default:
  $added_uri[] = str_replace($remove_nasties, '', $qs_parts[$i]); //  Found the additional querystring (e.g. &page=3&sort=2a from  split_page_results)
 }
}
( strpos($_SERVER['REQUEST_URI'], '-p-') ? ($querytype = 'filename_product_info-products_id=' . $HTTP_GET_VARS['products_id']) :
( 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['pID']) :
( 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=' .  $HTTP_GET_VARS['products_id']) :
( strpos($_SERVER['REQUEST_URI'],  '-pri-') ? ($querytype = 'filename_product_reviews_info-products_id=' .  $HTTP_GET_VARS['products_id']) :
( strpos($_SERVER['REQUEST_URI'],  '-prw-') ? ($querytype = 'filename_product_reviews_write-products_id='  . $HTTP_GET_VARS['products_id']) :
( strpos($_SERVER['REQUEST_URI'], '-i-') ? ($querytype = 'filename_information-info_id=' . $HTTP_GET_VARS['info_id']) :
false ))))))))) );
$validate_array = explode('-', $querytype);
$linkreturned = tep_href_link(constant(strtoupper($validate_array[0])), $validate_array[1]);
// Rebuild the extra querystring
( (strpos($linkreturned, '?') !== false) ? ($seperator = '&') : ($seperator = '?') ); // Is there an osCid on $linkreturned?
$count = count($added_uri); // Count the extra querystring items
for ($i=0; $i<$count; $i++)
if  ($i == 0) $linkreturned = $linkreturned . $seperator .  tep_sanitize_string($added_uri[$i]); //add the first using seperator ?  or &
else $linkreturned = $linkreturned . '&' . tep_sanitize_string($added_uri[$i]); // Just add "&" this time
$linkreturnedstripped = str_replace( strstr($linkreturned, '?'), '', $linkreturned);
$linktest = str_replace(HTTP_SERVER . DIR_WS_HTTP_CATALOG, '', $linkreturned); // Pair the url down to the querystring
if (strpos($linktest, '-') === 0) { // If the link returned by seo.class.php has no text mysite.com/-c-xxx.html
$dohome = tep_href_link(FILENAME_DEFAULT); // It means that the page no longer exists (assuming the class is working)
header("HTTP/1.0 404 Not Found"); // Set header 404 Not Found
header("Location: $dohome"); // .. 404 redirect to index.php .. and never come back!!!
exit;
} else if ( HTTP_SERVER . $core != $linkreturnedstripped ) { // Link looks bad so 301
header("HTTP/1.0 301 Moved Permanently"); // redirect to the good version
header("Location: $linkreturned"); // 301 redirect
exit;
}
################################################
// END fwrmedia.co.uk mod to check SEO link validity
}

 

Can anybody else confirm if they are getting these problems?

Share this post


Link to post
Share on other sites
I'm having an issue with adding duplicate products to the shopping basket. The first product gets added correctly but if you click on the product in the basket, the product info page appears as expected but when you try to add it to the basket again everything in the basket is deleted.

 

That seems to be a fault of your site not this contribution.

 

I'm still able to add any string to get to the products e.g.

 

http://www.teetreedesigns.co.uk/anyoldrubbish-p-111.html

 

Gives the same as:

 

http://www.teetreedesigns.co.uk/yodafone-p-111.html

 

You needed to turn it on in admin, seems you have now :D

 

Or maybe you mean, if I use the url ..

 

http://www.teetreedesigns.co.uk/anyoldrubbish-p-111.html

 

I arrive at the url

 

http://www.teetreedesigns.co.uk/yodafone-p-111.html

 

If so this is exactly what it is meant to do .. it recognises the first as a bad URL and 301 redirects to the 2nd .. this is validation.

Edited by Babygurgles

Share this post


Link to post
Share on other sites

And after taking another look the problem you have is due to bad coding/hardcoded links in shopping_cart.php.

 

product_info.php?product_id=111

 

If shopping_cart.php was correctly coded to use tep_href_link then the url would be correctly generated and you "probably" wouldn't have a problem.

 

As it stands the code from this contribution is reading product_info.php?product_id=111 as a bad link (which it is when using SEO URLS) and is therefore 301 redirecting to the good URL.

Edited by Babygurgles

Share this post


Link to post
Share on other sites
Have you hardcoded all your filenames or something? for example what happens if you put in header.php

 

<?php

echo FILENAME_DEFAULT . '<br />';

?>

 

 

I did this and it just echoed index.php on my main page.

Share this post


Link to post
Share on other sites
I did this and it just echoed index.php on my main page.

 

I would need to see the url with seo turned on. But it looks to me like one of the FILENAME_ (where it's a filename used by Ultimate SEO) constants doesn't exist.

 

Try changing includes/functions/general.php function tep_validate_seo_urls()

 

$linkreturned = tep_href_link(constant(strtoupper($validate_array[0])), $validate_array[1]);

 

To ..

 

$linkreturned = tep_href_link(constant('' . strtoupper($validate_array[0]) . ''), $validate_array[1]);

Edited by Babygurgles

Share this post


Link to post
Share on other sites

Hi Babygurgles,

 

I have used your latest fix version and chemos version 2.2.2e on a slightly modified 2.2ms

My test site: http://www.goodies.dk/shop/index.php?language=en (shop in Danish, and no language selector, therefor this link)

 

Problem is " more details" button where is doesent rewrite url correctly. I dont know where to look for the error, your fix or chemo original.

Any ideas?

 

cheers!

 

Kenneth

Share this post


Link to post
Share on other sites
Well I've packaged it now with auto install admin settings (turn URL validation on/off).

 

But I want some more feedback before I think of putting it up as an active contribution.

 

The package is attached I'll delete the old one.

Hi Robert

 

I have installed your contribution using v.2.1c & it appears to work exactly as you say & as per testing notes. :thumbsup:

 

Thanks

Julie

Share this post


Link to post
Share on other sites
Hi Babygurgles,

 

I have used your latest fix version and chemos version 2.2.2e on a slightly modified 2.2ms

My test site: http://www.goodies.dk/shop/index.php?language=en (shop in Danish, and no language selector, therefor this link)

 

Problem is " more details" button where is doesent rewrite url correctly. I dont know where to look for the error, your fix or chemo original.

Any ideas?

 

cheers!

 

Kenneth

 

I would say "neither" looks to me like the link is not using tep_href_link which it must if it is to be converted to an SEO URL.

 

A quick way to test my contribution is simply to turn it off in admin and see if the link stays the same (and it will)

Edited by Babygurgles

Share this post


Link to post
Share on other sites
I would need to see the url with seo turned on. But it looks to me like one of the FILENAME_ (where it's a filename used by Ultimate SEO) constants doesn't exist.

 

Try changing includes/functions/general.php function tep_validate_seo_urls()

 

$linkreturned = tep_href_link(constant(strtoupper($validate_array[0])), $validate_array[1]);

 

To ..

 

$linkreturned = tep_href_link(constant('' . strtoupper($validate_array[0]) . ''), $validate_array[1]);

 

 

Okay i did the following above and Got this the same error..

 

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!

 

On this Category link : http://www.vmart.pk/main/cdr-cdrw-c-2.html

Share this post


Link to post
Share on other sites
Okay i did the following above and Got this the same error..

 

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!

 

On this Category link : http://www.vmart.pk/main/cdr-cdrw-c-2.html

 

Ok I think there's a problem where products have -(hyphen) in the name

 

Brb

Share this post


Link to post
Share on other sites

includes/functions/general.php

 

Find ..

 

( strpos($_SERVER['REQUEST_URI'], '-p-') ? ($querytype = 'filename_product_info-products_id=' . $HTTP_GET_VARS['products_id']) :
( 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['pID']) :
( 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=' . $HTTP_GET_VARS['products_id']) :
( strpos($_SERVER['REQUEST_URI'], '-pri-') ? ($querytype = 'filename_product_reviews_info-products_id=' . $HTTP_GET_VARS['products_id']) :
( strpos($_SERVER['REQUEST_URI'], '-prw-') ? ($querytype = 'filename_product_reviews_write-products_id=' . $HTTP_GET_VARS['products_id']) :
( strpos($_SERVER['REQUEST_URI'], '-i-') ? ($querytype = 'filename_information-info_id=' . $HTTP_GET_VARS['info_id']) :
false ))))))))) );
$validate_array = explode('-', $querytype);

 

Replace with ..

 

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

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  

×