Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

duplicate links with - 1 - 2 etc ....
(1 viewing) (1) Guest
Support forum for users using free edition of JoomSEF 3 (Joomla 1.5 compatible). These forums are mainly for mutual help between users.

Please note that due to our capacity limitations, we do not monitor these forums regularly.

TOPIC: duplicate links with - 1 - 2 etc ....

Re:duplicate links with - 1 - 2 etc .... 18 years, 1 month ago #430

  • nibra
I have the same issue with 1.2.5 in conjunction with a custom component. Just now, up to 23 identical links with different numeric suffix are generated (for the same Itemid). I wrote a sef extension as shown in the example, and it seems to work - all but these duplicated links. Have I to address the Itemid in a special way, even if it is not used by the component? Did I miss anything?

TIA
Niels

[SOLVED?] Re:duplicate links with - 1 - 2 etc .... 18 years, 1 month ago #437

  • nibra
I found a solution for my duplicate entry issue. It was caused ba the fact, that the non-SEF URL was stored without correct encoding. Therefore, any URL with a space or any special character were not found in the cache.

To solve this, the function sefGetLocation() has to be changed near line 500 in file /components/com_sef/sef_ext.php:

 
else {
// put it in the database
// <mod package="BugFix" author="Niels Braczek" date="2006-10-05">--------------
// Original code stores illegal URLs, so comparision failes
// oldurl is ok, but newurl must be quoted correctly
$new_url = new Net_URL( $url );
$new_url = str_replace( $GLOBALS['mosConfig_live_site'].'/', '', $new_url->getUrl() );
$query = sprintf( "INSERT INTO #__redirection (oldurl, newurl) VALUES (%s, %s)",
$database->quote( $temploc ),
$database->quote( $new_url )
);
// original code:
// $query = 'INSERT INTO #__redirection (oldurl, newurl) '.
// "VALUES ('".$temploc."', '".addslashes(urldecode($url))."')";
// </mod>-----------------------------------------------------------------------
$database->setQuery($query);
if (!$database->query()) {
var_dump($query);
}
}
 


Hope it helps you, too
Niels

Re:[SOLVED?] Re:duplicate links with - 1 - 2 etc . 18 years, 1 month ago #450

  • Murat
Your hack does not work.

Re:duplicate links with - 1 - 2 etc .... 17 years, 12 months ago #994

This is the solution :


AFTER :

//shorten the url for storage and for consistancy
$url = str_replace('&', '&', $url);


ADD :

// UPDATE TO KICK DUPLICATE CONTENT
$g=explode('&',$url);
if(sizeof($g)==2) return $url;
$url = str_replace('index.php?', '&', $url);

$url2 = explode('itemid=',$url);
$url3 = explode('&',$url2[1]);
$url=$url2[0].$url3[1];

$url = explode('&',$url);
sort($url);
$url=implode('&',$url);
$url = 'index.php?'.$url;
// END UPDATE


this solution is in test but appear to be OK

EDIT: not academic but i do as i can<br><br>Post edited by: Ultim_fr, at: 2006/11/30 11:57

Re:duplicate links with - 1 - 2 etc .... 17 years, 12 months ago #1001

Can anyone confirm that this is working?

I really dont wanna be penalized with &quot;duplicate content&quot; from google.. because that can ruin my site.

I have ran over almost every link i made in my site, but still have some &amp;itemid=1 &amp;itemid=2 links wich get generated and i dunno where they come from.. :( wich turns just a couple of pages into -2, -3, -4 links.. :(

This is a really important issue that needs to be adressed, since i dont have any custom module, im using joomla right out of the box, but for some reason intern links to categories / items/ content gets a duplicate number :(<br><br>Post edited by: erinys, at: 2006/12/01 08:54

Re:duplicate links with - 1 - 2 etc .... 17 years, 12 months ago #1002

Btw im getting links added into the &quot;custom SEF urls&quot; automatically, and i dunno why :(

I have 11 links inthere now, 1 i made myself, but the rest is auto-added for no particular reason it seems.
User Login Empty