CodeIgniter Forums
requested URL was not found - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: requested URL was not found (/showthread.php?tid=13141)

Pages: 1 2


requested URL was not found - El Forum - 11-12-2008

[eluser]versatilia[/eluser]
Ok im really stumped now, i have moved a codeigniter site from one of my servers over to another server and ive run into a problem i have no idea how to fix.

Basically the main page will load up if i just access the root directory but if i use any of the links of my site which should load the apropriate controller and class i just get a 404 error;

The requested URL /stripped/downloads/artist/0 was not found on this server.


I have updated the config file to reflect the new server and i have no idea what else could be causing it. I have checked the apache logs and this is what i get for example;

[12/Nov/2008:17:09:07 +0000] "GET /stripped/downloads/artist/0 HTTP/1.1" 404 364 "http://milo.burnley.office.versatilia.com/stripped/" "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3 (.NET CLR 3.5.30729)"

Any ideas?


requested URL was not found - El Forum - 11-12-2008

[eluser]lmv4321[/eluser]
Please post some code from your controller and view.


requested URL was not found - El Forum - 11-12-2008

[eluser]ray73864[/eluser]
sounds like a .htaccess problem, check your config.php file, it may be that you have a .htaccess on your local server but not on the remote one and config.php is missing the 'index.php' config value.

if that config value isn't set then CI automatically assumes that you are going to handle what happens by way of a .htaccess file and mod_rewrite.


requested URL was not found - El Forum - 11-13-2008

[eluser]versatilia[/eluser]
i do have a .htaccess file in the root which says;
RewriteEngine on
RewriteCond $1 !^(listing\.php|index\.php|png|assets|user_guide|css|js|images|gfx|files|forum|blog|scripts|robots\.txt|favicon\.ico)
RewriteRule ^(.*) /index.php?$1 [L]

AddType text/x-component .htc

This works fine on the development server and the live server that is out on the internet now, but on this new server that im trying to make a copy of it on for some reason it just wont work. Can't really post any code from my controller / view due to the very sensative nature of the project.

Any help would be great tho.


requested URL was not found - El Forum - 11-13-2008

[eluser]wiredesignz[/eluser]
This htaccess will most likely work for you and allows you to use both segments and query strings.

http://ellislab.com/forums/viewthread/96347/

Add your own final RewriteCond{s) to suit.


requested URL was not found - El Forum - 11-13-2008

[eluser]versatilia[/eluser]
Just gave that a try and it doesnt work, produces the same problem. I could really do with finding out what the hell has gone wrong here because i need to develop the site on this new server as its running a newer vervsion of php, the original server was on 5.2.1 and it has a bug in it with 64bit servers.

What i really dont get is that it basically copied over perfectly to the live server once the config file was changed it just worked... but this is just being a pain


requested URL was not found - El Forum - 11-13-2008

[eluser]versatilia[/eluser]
I should also point out that when i go to http://milo.burnley.office.versatilia.com/stripped/ (which is essentially the front page) the site actually works but as soon as i click on a link etc it craps out with the page can not be displayed error.


requested URL was not found - El Forum - 11-13-2008

[eluser]wiredesignz[/eluser]
Are you running you app in a sub directory or from docroot?

plus it might help us if you post code from config/routes.php as well.


requested URL was not found - El Forum - 11-13-2008

[eluser]versatilia[/eluser]
the app is in a sub directory, http://milo.burnley.office.versatilia.com/ is the root directory of the server and the site is in /stripped/.


$route['default_controller'] = "downloads";
$route['scaffolding_trigger'] = "";

Thats whats in my routes file basically. Do you think it could be because im running it in a sub directory?


requested URL was not found - El Forum - 11-13-2008

[eluser]wiredesignz[/eluser]
[quote author="versatilia" date="1226595729"]the app is in a sub directory, http://milo.burnley.office.versatilia.com/ is the root directory of the server and the site is in /stripped/.

Do you think it could be because im running it in a sub directory?[/quote]

Yes totally, Your htaccess is set to operate in the docroot.
Code:
/index.php?$1 [L] # `/` indicates docroot.

/stripped/index.php?$1 {L] # may work, or add

RewriteBase /stripped/ # after RewriteEngine On, and use

index.php?$1 [L]

If you run on a CGI server my previous code will work and needs altering to suit a sub directory.