Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Joomla! root directory

I have the following directory structure:

C:\mywebsites
  \site_1
  \site_2
  \site_n

In 'site_2' I have joomla installed, however, I have other folders with resources, php scripts, etc. in one of the 'extra' folders, I have scripts that I'm frequently calling, the trouble comes when I call JURI::base(), it returns the folder in which the script file is, in stead of 'site_2' which I'm expecting.

How can I overcome this simple task?


2 Answers

The root directory is defined in JPATH_BASE.

It's set in the index.php in the Joomla front end and in the /administrator using:

define('JPATH_BASE', dirname(__FILE__));

JURI::base() returns the base request path.

like image 154
Craig Avatar answered Jan 25 '26 20:01

Craig


define('JPATH_BASE', dirname(FILE));

is return your local drive path.. means c:/site_1/site_2/site_3/

JURI::base()

is return the livefolder path... means http://localhost/site_1/site_2/site_3/

like image 30
KiNG H Avatar answered Jan 25 '26 21:01

KiNG H



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!