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?
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.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With