Welcome Guest, Not a member yet? Register   Sign In
Page not found
#1

[eluser]bso[/eluser]
On my current server configuration I can change the default controller easily enough to load any controller effectively. However, if I try to load a controller through the URL I get a "Page Not Found" error.

Code:
http://localhost/index.php >> effectively loads default controller
http://localhost/index.php/default_controller >> 404 error
http://localhost/index.php/other_controller >> 404 error

Any suggestions on what might be wrong with my server configuration?

Running PHP 4.4.1
#2

[eluser]Dam1an[/eluser]
Have you tried the differant URI protocols in the config file?
#3

[eluser]mjsilva[/eluser]
Check your $config['base_url'] in config.php and check if you don't have any .htaccess in your site root directory to see if u don't have any weird rewrite rules.

Before checking your .htaccess you might want to test accessing it like this:
http://localhost/default_controller
http://localhost/other_controller
#4

[eluser]bso[/eluser]
Dam1an, thanks for the reply!
I've just finished testing all of the URI Protocols in the config file. Results were the same, except "PATH_INFO" gave me a 404 on the index.php file itself. Was surprised that even QUERY_STRING wouldn't work with:
http://localhost/index.php?c=default_controller

mjsilva, Also thank you for your reply!
There is no .htaccess file in my root directory, and those other paths do not work for me.

Other suggestions?
#5

[eluser]unsub[/eluser]
Hello,

I had what sounds like the same problem. I can't say for sure it's the same cause, but this fixed it for me (thanx to threads on this forum):
switched my uri protocol to:
Code:
$config['uri_protocol']    = "REQUEST_URI";
and added an .htaccess to my root dir with this in it:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico|license.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

You mentioned you don't have an .htaccess file. Are you in a position to add one? Or will your server admin help you with configuration?

There are some htaccess gurus here, and I am a rank beginner with it, so I'm unfortunately the wrong one to explain what most of that stuff means, or whether it's wise to add one to your root. I've done it before with no ill effects, but always on the instructions of others.

If you are on shared hosting, a lot of shared hosts apparently will give you this result.

Cheers
#6

[eluser]bso[/eluser]
Thanks unsub,

I'm sorry to say that there weren't any new results with that method either.

I tested:

http://localhost/index.php/blog
http://localhost/blog

Neither worked.
#7

[eluser]unsub[/eluser]
doh... I'm sorry, i wasn't reading carefully enough! the "localhost" in your url escaped my notice completely, so my advice was daft on at least one level Tongue

Are you using a pre-packaged testing server, like xampp / lampp ? or is it a self configured set-up?
The reason I ask is that I'm using xampp, and my CI stuff works; so although I'm a bit of a beginner with server stuff, I could at least compare settings with you if you are using the same one.

Others might have specific experience with your setup if you post it.

cheers
#8

[eluser]bso[/eluser]
Sorry, I might have been the one being daft.

I should've said that I tested:

http://mydomain.com/........

I am using a shared hosting environment.

Are there any things I should be looking for in the Apache or PHP configuration to make this linking work?
#9

[eluser]Kami_[/eluser]
Your host is probably using PHP as cgi binary.

This .htaccess should work:

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|favicon.ico)
RewriteRule ^(.*)$ /index.php?/$1 [L]

(mind the ? after the index.php).
#10

[eluser]unsub[/eluser]
Hi bso,

I'm afraid I don't know of anything in the Apache or PHP configurations. Sorry about that.

I am very much a beginner when it comes to server stuff. The most complex problem I've ever solved in that regard was turning off register globals! haha Smile
But hopefully someone else here can chime in on that.

The only other thing I would suggest is looking into the .htaccess situation. You mentioned that there isn't one. Is that because your host doesn't allow them on a per-directory basis? I would ask your host about it, maybe.
The method that I used is reliant on the .htaccess settings, unfortunately, so it won't work without one.
I think a couple of the others are too, depending on your server.

One thing I noticed when doing some work for a client whos server I only had FTP access to - he did have an .htaccess file, but it was hidden from view by default, so I couldn't see it when browsing with FTP. So before adding one, make sure that you won't be overwriting an existing but hidden one. Wink

Wish I could be of more assistance.

Cheers




Theme © iAndrew 2016 - Forum software by © MyBB