Foren / Cotonti / Support / Handy URLs and URL links.

Questions...

lukgoh
#34143 1. Mai 2012, 10:41

Hello guys, 

I am completely new to URL transformation and with help I setup my Cotonti to use the Handy URLs, which is perfect. 

I have created a module and to get the same results (www.domain.com/module/$u) I added a page that hooks into urleditor.functions.php like this: 

<?php
/* ====================
[BEGIN_COT_EXT]
Hooks=urleditor.rewrite.first
[END_COT_EXT]
==================== */

/**
 * Clan Module for Cotonti CMF
 *
 * @package Clan
 * @version 1.0
 * @author DesignLizard
 * @copyright (c) 2012 DesignLizard
 * @license BSD
 */

defined('COT_CODE') or die('Wrong URL');

if ($path[0] == 'clans')
			{
				
				// Clan profiles
				$_GET['e'] = 'clans';
				$_GET['u'] = $path[1];
				return;
			}
?>

My question/problem is when creating a url like this: cot_url('clans', 'u=' . $rowgettopclans['clan_name_short']) it outputs a link like this: /clans?u=mli instead of clans/mli which is the correct link. I was wondering what I am doing wrong, or what needs to be done to get the correct url.