I've added a brand new directory during my joomla website:

http://sitedomain.tld/xxx/

i quickly have added index.php for the reason that directory

this is actually 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

After I view this site within the browser, all of the dynamic links like CSS, JS and pictures were suffixed through the /xxx/ path which will make them damaged !

How do i drop this suffix or how do you change this suffix from /xxx to / into it indicates the initial files location?

I've attempted setting the JDocument::setBase as well as attempted to experience using the JURI object and transformed its _path and _uri with no change

Thanks

Should not JPATH_BASE be a complete path (eg. realpath('..'))?

Also, you can test setting in template.

I do not recommend circumventing the Joomla rendering process such as this. You'd be much best developing a component instead of attempting to do whatever you are goals are here.

Basically I believe the problem is you are really developing a new instance and a lot of things expect assets to become situated in a few pathways. You are requesting lots of trouble here, I can not even being to think about all of the configurations that might be impacted by this move. That's why I wouldn't do that, making a component.