I just got a new CodeIgniter project and I think I have either routing problems or a .htaccess problem, the situation is like this:
The project is on a domain like this : www.example.com, and of course I need a copy of it in my /var/www/html/project folder because I don't want to work directly on the production server.
So I downloaded it and managed to get the front end part working perfectly from my localhost/project folder (actually I ended up using the ip address because if I use localhost it gows to www.localhost.com/project for some reason eventhough I edited the htacces file, but i can work with the ip).
Now the thing is something really weird is going in the back office part, I mean if I type 127.0.0.1/project/admin it gows to 127.0.0.1/project/admin/admin/login insteand of /admin/login.
And the links to all the css and js files are weird and can't figure out where this weirdness comes from.
Here are some pics:
So as you can see in the picture above in the code it looks ok that's the path to the folder css/admin.css which is correct, but if you look in the console you can see that it tries to load admin/css/admin.css which of course it's not ok.
Now when I type in the adress bar : 1270.0.0.1/project/admin it goes to 127.0.0.1/admin/admin/ login and of course it goes 404 on me, but if I specify: 127.0.0.1/project/admin/login than it loads what you see in the picture above.
Below I will put the routes and stuff from the config file:
Routes:
$route['default_controller'] = "home";
$route['scaffolding_trigger'] = "";
//variables
$lang = "([a-zA-Z]{2}/)?";
$index_lang = "([a-zA-Z]{2}/?)?";
//admin
$route["admin"] = "admin";
$route["admin/(.*)"] = "admin/$1";
From the config:
$config['base_url'] = "";
$config['admin_url'] = $config['base_url']."admin/";
$config['base_path'] = $_SERVER['DOCUMENT_ROOT']."/project/";
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = "index.php";