Changing URI suffix in Joomla when adding child php pages

Posted by Sleem on Stack Overflow See other posts from Stack Overflow or by Sleem
Published on 2010-04-16T08:45:28Z Indexed on 2010/04/16 8:53 UTC
Read the original article Hit count: 457

Filed under:
|
|
|
|

I have added a new directory in my joomla website:

http://sitedomain.tld/xxx/

then I have added index.php in that directory

here is the code

    define( '_JEXEC', 1 );

define('JPATH_BASE', '..' );

define( 'DS', DIRECTORY_SEPARATOR );

require_once ( '../includes/defines.php' );
require_once ( '../includes/framework.php' );




//JDEBUG ? $_PROFILER->mark( 'afterLoad' ) : null;

/**
 * CREATE THE APPLICATION
 *
 * NOTE :
 */



$mainframe =& JFactory::getApplication('site');
$template_name = $mainframe->getTemplate();;

$mainframe->initialise();

JPluginHelper::importPlugin('system');


/**
 * ROUTE THE APPLICATION
 *
 * NOTE :
 */
$mainframe->route();

// authorization
$Itemid = JRequest::getInt( 'Itemid');
$mainframe->authorize($Itemid);

// trigger the onAfterRoute events
//JDEBUG ? $_PROFILER->mark('afterRoute') : null;
//$mainframe->triggerEvent('onAfterRoute');

/**
 * DISPATCH THE APPLICATION
 *
 * NOTE :
 */
$option = JRequest::getCmd('option');
//$mainframe->dispatch($option);

// trigger the onAfterDispatch events
//JDEBUG ? $_PROFILER->mark('afterDispatch') : null;
//$mainframe->triggerEvent('onAfterDispatch');

/**
 * RENDER  THE APPLICATION
 *
 * NOTE :
 */

$mainframe->render();    


/**
 * RETURN THE RESPONSE
 */

var_dump($document->getHeadData());
echo JResponse::toString($mainframe->getCfg('gzip'));

sdwdwd wdwd

When I view this page in the browser, all the dynamic links like CSS, JS and images were suffixed by the /xxx/ path which make them broken !

How can I drop this suffix or how do I change this suffix from /xxx to / to it points to the original files location?

I have tried setting the JDocument::setBase and also tried to play with the JURI object and changed its _path and _uri without any change

Thanks

© Stack Overflow or respective owner

Related posts about joomla

Related posts about uri