I know that there are a lot of solutions for this problem. But i've tried a lot of difference aproaches and non of them help. Explanation of the problem: When i set my CI project on the host webserver in a subfolder or Subdomain it only loads the default controller. On local everything works fine.
I've tried disabling all routes, didn't help
EDIT things tried:
My Settings:
$config['uri_protocol'] = "REQUEST_URI";
$config['index_page'] = '';
$config['base_url']= 'http://www.mywebsite.nl/klanten';
or for the subdomain:
$config['base_url']= 'http://klanten.mywebsite.nl/';
My htaccess:
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|img|stylesheets|javascript)
RewriteCond $1 !^(index\.php|img|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
I'm running on a php 5.3.15 with CI 2.1.2
Any ideas are welcome!
I did something, that i don't like to do, to fix it. First of all, yes i tried update CI but this didn't do anything..
So my solution for CI2.1.2 was the following:
Core/URI.php :185
$uri = $_SERVER['REQUEST_URI'];
if (strpos($uri, $_SERVER['SCRIPT_NAME']) === 0)
{
if($_SERVER['REMOTE_ADDR'] == "127.0.0.1" || $_SERVER['REMOTE_ADDR'] == "::1")
{
$uri = substr($uri, strlen($_SERVER['SCRIPT_NAME']));
}
else
{
$uri = ltrim ($uri,'/');
}
This was a working solution for me when i place the CI website in a Subdomain, When you place it in a subfolder the else should probably be like this:
$uri = ltrim ($uri,'/subfolder/');
I hope it helps anyone, if there is a better way to achieve this, please say so.
Do you want to load default controller? have you tried the settings on routes
file
$route['default_controller'] = 'klanten';