Welcome Guest, Not a member yet? Register   Sign In
Default Route not working - strange !?
#1

[eluser]toadle[/eluser]
Hey everybody,

I just built my first project with CI and everything worked fine on my local development-environment. Now I've moved the project to my server, for client-review. Now I'm experiencing a problem. The default-route doesn't work anymore.

http://aem.tim-adler.com (doesn't work)
http://aem.tim-adler.com/page (works)

In routes.php I have
Code:
$route['default_controller'] = "page";
and the page-controller has a working index()-function.

and a .htaccess-file which looks like this
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>

I tried debugging the HTTP-Request, but this doesn't make any sense either. Would you guys have any advise?
#2

[eluser]toadle[/eluser]
I investigated this further:

This works

http://aem.tim-adler.com/index.php/

however, this does not

http://aem.tim-adler.com/index.php

What could be the reason for that?!
I don't get it, plz help!
#3

[eluser]toadle[/eluser]
Found it: The Apache "DirectoryIndex" was not set to set "index.php"
#4

[eluser]toadle[/eluser]
Err, no....the error came back!

This seems something not reproducable, sometimes it works, sometimes it doesn't..

I'm totally cluelesss, plz someone help me here!
#5

[eluser]ekeretex[/eluser]
What do you have as the base_url in the config file?
Does it have the ending slash included? Found out it works best for me that way.
#6

[eluser]toadle[/eluser]
Yep, I have that set. But I just found something out through code-reading:
The method "_get_uri_string" in the Routes-Class hands out something totally senseless in my environment. The path-info that it creates are comming from a totally different page on my server...

e.g. I'm requesting http://aem.tim-adler.com/
and _get_uri_string hands out something like /vista-mac-windows/ which is a Python-path from another page on that server....totally weird!

What is going in here?! This looks like a bug...
#7

[eluser]toadle[/eluser]
I'm self-replying all the time here, cause I wanna make this transparent for other users:

I now found a hopefully relyable fix: Setting the $config['uri_protocol'] to "REQUEST_URI"; seems to have fixed it...
#8

[eluser]ekeretex[/eluser]
Are you on windows? I did see something somewhere about that being a fix for windows.
#9

[eluser]toadle[/eluser]
Nope that system showing the problem is a SUSE 9.3 Linux with Apache 2 and PHP 5.2.5!
#10

[eluser]kenbacca[/eluser]
Thanks toadie!!!

I was having the same problem and this fixed it.




Theme © iAndrew 2016 - Forum software by © MyBB