Page 1 of 1

Bug running Joomla under Windows

Posted: Thu Jan 19, 2012 12:46 am
by AnnyPaws
(This is my first bug report, so excuse me if I'm doing something wrong.)

I've installed joomla in a subdirectory, and want to hide it from the url. I'm using htaccess, and changed the $live_site to something like $live_site='http://localhost.client/'. Front-end works fine, but I can't login to the administrator. It tries to redirect to http://localhost.client/index.php . When the $live_site is empty, the admin works fine, but the subdirectory is visible in my urls on the front-end.

After some days of researching and testing, I've figured out what is wrong.

In the file: \libraries\joomla\environment\uri.php
Line 213, there is an if that looks like this:

if (JPATH_BASE == JPATH_ADMINISTRATOR) {

In my case, this "if" was comparing this: D:\server\htdocs\client\folder\administrator
with this: D:\server\htdocs\client\folder/administrator

The second value has a / instead of \ (I think its because I'm working under windows). So I suposse the command inside the "if" would never be executed on Windows.

So I changed the if to this:

if (JPATH_BASE == str_replace("/","\\",JPATH_ADMINISTRATOR)) {

And now everything seems to be working fine, back-end and front-end.

P.S.: Sorry for my english. :}