![]() |
Router.php & "/" - 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: Router.php & "/" (/showthread.php?tid=8875) Pages:
1
2
|
Router.php & "/" - El Forum - 06-03-2008 [eluser]SplashCreativity[/eluser] Hey I'm getting some errors whenever I have a trailing slash on my url. http://mysite.com/index.php is fine http://mysite.com/index.php/ gives me errors Same goes without the index.php, though if I do http://mysite.com/controller/ It's fine, the routing works fine. Here are the errors: Quote:A PHP Error was encountered Router.php & "/" - El Forum - 06-04-2008 [eluser]louis w[/eluser] Strange, this should not be a problem. Have you made any changes to the routers config? Are you on a Windows server? Router.php & "/" - El Forum - 06-04-2008 [eluser]SplashCreativity[/eluser] I haven't made any changes nope, also it is hosted on a normal dreamhost server (linux). The problem doesn't occur if I remove the .htaccess Router.php & "/" - El Forum - 06-04-2008 [eluser]MCrittenden[/eluser] What does your .htaccess look like? Router.php & "/" - El Forum - 06-04-2008 [eluser]SplashCreativity[/eluser] I have removed it for the time being, something strange was happening. On dreamhost, eventually the .htaccess file would disappear (though it would still be taking effect) and then my css folder wasn't working (possibly because it saw http://mysite.com/css/ as http://mysite.com/index.php/css/) so I tried to add css| after images| (using the example htaccess file from the userguide)... this broke the htaccess. Ultimately I think I will place my CSS in the images folder, or root directory. If somebody could supply me with a htaccess which will work with 1.6.2 I would be most grateful. Regards Stephen Router.php & "/" - El Forum - 06-04-2008 [eluser]MCrittenden[/eluser] The wiki has one that has worked fine for me, although I just noticed that there is a separate wiki page for Dreamhost users that you might want to try. Good luck! Router.php & "/" - El Forum - 06-04-2008 [eluser]louis w[/eluser] If you have: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d In your htaccess you should not have to add directories to exclude. I would hate to have to maintain a list like that. Are you sure the .htacess is dissapearing and not just being hidden. A lot of ftp clients will not show files which start with a period. Router.php & "/" - El Forum - 06-04-2008 [eluser]SplashCreativity[/eluser] Thanks for the quick replies, sorry I am late checking them. I didn't notice dreamhost had a seperate htaccess setup. I shall try that now Also I am using FileZilla. I don't have the above rewriteconds in my htaccess louis w though I will see how the wiki treats me, if it goes well I shall let you know Router.php & "/" - El Forum - 06-19-2008 [eluser]Unknown[/eluser] I don't know if this has been solve or not, but I'll go ahead and post my solution for the same problem I had with my server. File: Router.php Method: _set_routing() Line: 94 (without modification) Code: //Look for this: For some reason $this->uri->uri_string yields "/" using var_dump(). So the solution was pretty simple in my case. All that needs to be done is do a check and empty it out. Code: // Fetch the complete URI string By looking at that code, I advice not be tempted to do something I was going to do ... like this: Code: if ($this->uri->uri_string == '' || $this->uri->uri_string == '/') The "if" condition really wants to make sure that ... Code: $this->uri->uri_string = '' I hope this helps the OP or anyone that may have this problem in the future. Note that I'm with Mediatemple with Grid Server (gs) Router.php & "/" - El Forum - 06-20-2008 [eluser]SplashCreativity[/eluser] I've read your reply and I have to say it makes perfect sense, I can't try it right now but I definately will later on this evening, I'll let you know how it works out. Best Regards Stephen |