- Posts: 19
COMMUNITY FORUM
The url is longer than it should be
- Fahad
-
Topic Author
- Offline
- New Member
When I search for something on my site www.islamqa.no using a CSE component called gsearch, and then click on the link, it adds an extra long link then the original.
Try clicking on the first link shown here: islamqa.no/avansert-sok/gsearch?searchword=advare&areaid=
It looks like this: islamqa.no/kategorier/teologi-og-trosforstaelse/sekter-og-grupperinger/item/61-burde-han-advare-sine-venner-mot-a-lytte-til-denne-da-iyah/61-burde-han-advare-sine-venner-mot-a-lytte-til-denne-da-iyah
If go to the same article from the categories it looks like this: islamqa.no/kategorier/teologi-og-trosforstaelse/sekter-og-grupperinger/item/61-burde-han-advare-sine-venner-mot-a-lytte-til-denne-da-iyah
I asked the developer of gsearch about the case and he said:
It's K2 issue.
I see that K2 uses wrong canonical link for page islamqa.no/kategorier/teologi-og-trosforstaelse/sekter-og-grupperinger/item/61-burde-han-advare-sine-venner-mot-a-lytte-til-denne-da-iyah:
<link href="islamqa.no/kategorier/teologi-og-trosforstaelse/sekter-og-grupperinger/item/61-burde-han-advare-sine-venner-mot-a-lytte-til-denne-da-iyah/61-burde-han-advare-sine-venner-mot-a-lytte-til-denne-da-iyah" rel="canonical" />
Is it possible to fix this?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
They are meant for com_content and they fail to work properly in K2.
www.robertwent.com/blog/joomla/87-how-to-remove-joomla-s-canonical-tag-without-hacking-the-core
Please Log in or Create an account to join the conversation.
- Fahad
-
Topic Author
- Offline
- New Member
- Posts: 19
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Fahad
-
Topic Author
- Offline
- New Member
- Posts: 19
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Make sure that $doc is not declared elsewhere.
Please Log in or Create an account to join the conversation.
- Fahad
-
Topic Author
- Offline
- New Member
- Posts: 19
Is it possible for you to have a look at the issue if I send you login details on PM?
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
You cannot send PM. Try to revert your changes. Then ensure that you are using the latest version of both K2 ( 2.6.8 ) and Joomla! (3.3.3).
Please Log in or Create an account to join the conversation.
- Fahad
-
Topic Author
- Offline
- New Member
- Posts: 19
This is how the index.php file looks after the changes:
$doc = JFactory::getDocument();
foreach ( $doc->_links as $k => $array ) {
if ( $array == 'canonical' ) {
unset($doc->_links[$k]);
}
}
<?php
/**
*
* Main file
*
* @version 1.0.0
* @package Gavern Framework
* @copyright Copyright (C) 2010 - 2011 GavickPro. All rights reserved.
*
*/
// No direct access.
defined('_JEXEC') or die;
if(!defined('DS')){
define('DS',DIRECTORY_SEPARATOR);
}
// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');
// enable showing errors in PHP
//ini_set('error_reporting', E_ALL);
//ini_set('display_errors','On');
// include framework classes and files
require_once('lib/framework/gk.const.php');
require_once('lib/framework/gk.parser.php');
require_once('lib/gk.framework.php');
// run the framework
$tpl = new GKTemplate($this, $GK_TEMPLATE_MODULE_STYLES);
/* End of the file - index.php */
This is the text on the top of my site:
$doc = JFactory::getDocument(); foreach ( $doc->_links as $k => $array ) { if ( $array == 'canonical' ) { unset($doc->_links[$k]); } }
The problem is still here. I am now changing back to the original index.php file untill I hear from you again on how to solve it. Thanx
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6227
Please Log in or Create an account to join the conversation.
- Fahad
-
Topic Author
- Offline
- New Member
- Posts: 19
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
You should ask the template developer about this.
Please Log in or Create an account to join the conversation.