Welcome Guest, Not a member yet? Register   Sign In
requested URL was not found on this server
#1

[eluser]omidrs[/eluser]
Hi

So i am having some problems with codeigniter

I have it working on my localhost, but after having uploaded the files to my webserver i cannot get it working.

when i go to the main url eg www.example.com it works and load the homepage,
even www.example.com/index.php also works but not of my urls work. They all take me to a page not found. this is whether or not the index.php is in the url.

on my localhost i have all the settings to get the index.php out of the url. but on the webserver with all the same settings and the .htaccess file. none of the links work with or without the index.php in the url. I have spoken to someone at the webhosting service who tells me that all the wettings and the mod_rewrite stuff in the httpd.include file are all there.

Any help would be appreciated
#2

[eluser]Noah David[/eluser]
What happens when you go to http://www.example.com/index.php/controller? Where 'controller' is the name of your controller in CI?

Do you have access to your apache logs? If so, look and see what URL CI is trying to load when you see the Page Not Found errors.
#3

[eluser]omidrs[/eluser]
When i put in the url to go directly to the controller firefox displays this error
The requested URL /index.php/about was not found on this server
Apache/2.0.46 (Red Hat) Server at www.example.com Port 80
as far as access to the apache logs no I do not but i can ask to see if someone at my hosting service can send them to me.
#4

[eluser]Noah David[/eluser]
Definitely do that, as it will tell you exactly what page your script requested on the server.

It could be you need to edit your config.php file and change the base/root directory.

You probably had it set to http://localhost, and now that you're on a webserver, it would need to be changed to http://www.example.com
#5

[eluser]omidrs[/eluser]
no that's not the case
when i click the links the url loaded in the address bar is www.example.com/index.php/about

I know i have changed the base_url in the config.php

so its something else.

this is really frustrating.
#6

[eluser]omidrs[/eluser]
These are some of the errors from the error logs

[Fri Feb 29 13:34:18 2008] [error] [client 70.116.93.215] File does not exist: /home/httpd/vhosts/higherout.com/subdomains/madi/web/index.php/home
[Fri Feb 29 13:35:11 2008] [error] [client 24.153.221.179] File does not exist: /home/httpd/vhosts/higherout.com/subdomains/madi/web/index.php/news, referer: http://madi.higherout.com/
[Fri Feb 29 13:35:15 2008] [error] [client 24.153.221.179] File does not exist: /home/httpd/vhosts/higherout.com/subdomains/madi/web/index.php/about, referer: http://madi.higherout.com/
[Fri Feb 29 13:38:23 2008] [error] [client 70.116.93.215] File does not exist: /home/httpd/vhosts/higherout.com/subdomains/madi/web/index.php/about, referer: http://madi.higherout.com/index.php
[Fri Feb 29 13:38:27 2008] [error] [client 70.116.93.215] File does not exist: /home/httpd/vhosts/higherout.com/subdomains/madi/web/index.php/home, referer: http://madi.higherout.com/index.php
#7

[eluser]Michael Wales[/eluser]
Change the URI method to REQUEST_URI in config.php

I don't have the code in front of me to paste an exact example, but the comments in that file offer all of the possible setting. Try each and one of them should work.
#8

[eluser]omidrs[/eluser]
So this is the section from the config.php file

/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of "AUTO" works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO' Default - auto detects
| 'PATH_INFO' Uses the PATH_INFO
| 'QUERY_STRING' Uses the QUERY_STRING
| 'REQUEST_URI' Uses the REQUEST_URI
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = "AUTO";


This was my initial setup -> having it as AUTO

I tried each one of the other ones individually and no luck.
I mean if you have any idea of what is causing the problem, or why codeigniter is giving me the page 404, i would very much like to hear it.
cuz www.example.com/index.php gives me my home page and if any of the other pages are setup to be the default_controller they all work but, www.example.com/index.php/anything does not work. when i type it in the url or i click on any of my links

thanx in advance for the help u guys are offering
Thanx a bunch
#9

[eluser]Seppo[/eluser]
If non of the protocols works, you can use www.example.com/index.php?/anything and that should do it, althought it's not the nicest solution.

-Edit- I had this problem a couple of times, but always working with IIS, never with Apache
#10

[eluser]omidrs[/eluser]
Ok so apprently the solution was that in the .htaccess file on the server I had to change

this line: RewriteRule ^(.*)$ index.php?/$1 [L]
to this line: RewriteRule ^(.*)$ /index.php?$1 [L] (silly ass fix)

And now the site links work but I have to make sure that the index.php is not in any of the links




Theme © iAndrew 2016 - Forum software by © MyBB