500 Internal server error when clicking links - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: 500 Internal server error when clicking links (/showthread.php?tid=40270) |
500 Internal server error when clicking links - El Forum - 04-04-2011 [eluser]keld[/eluser] Hi all, I have this weird issue where the server returns a 500 internal server error when clicking a link to another page from my home page. When I load my site, the homepage shows up fine but none of the links are working but it works when the site is on localhost on my machine. Any idea why? Thank you. 500 Internal server error when clicking links - El Forum - 04-04-2011 [eluser]InsiteFX[/eluser] Show the code for your links! InsiteFX 500 Internal server error when clicking links - El Forum - 04-04-2011 [eluser]keld[/eluser] I'm using the anchor tag: Code: <?= anchor('recipes/recipe/'.$featured['nameuri'], $featured['name'], 'title="'.$featured["name"].'"') ?> The urls all look good like the way they should be. Some of my urls are html <a> tags but the same happens. 500 Internal server error when clicking links - El Forum - 04-04-2011 [eluser]d1a8lo24[/eluser] Not sure but if you're using an .htaccess file you should start there, most 500 errors are server configurations related where an apache configuration is not available for you. After that check your PHP.ini if your application is using any .ini configurations. 500 Internal server error when clicking links - El Forum - 04-04-2011 [eluser]InsiteFX[/eluser] Also short open tags could be turned off! Or if your passing the $data to the view and trying to use it in your anchor tags you are calling it wrong! Show your controller code! InsiteFX 500 Internal server error when clicking links - El Forum - 04-04-2011 [eluser]keld[/eluser] Yes I checked my htaccess I used to have a 500 error when I uploaded my site the first time because the htaccess wasn't transferred using the ASCII mode but Binary mode from Filezilla and it didn't like it. After re uploading it, it worked perfectly, at least for the homepage. There's another htaccess in thje "appllication" directory but eit is there to protect direct access to the source files, but even if I remove it, I still have the issue. (Again, this issue only happens when the site is online, locally, everything works fine). I really don't think it's coming from the links because even if I paste the url of another page than the home page it returns error 500. Anyway here's the controller for the homepage Code: function index() Code: $get_uri=$this->uri->segment(3); The url of this page looks something like : http://www.mysite.com/recipes/recipe/recipe-name But even opening a simple flat html page like terms and conditions doesn't work. 500 Internal server error when clicking links - El Forum - 04-04-2011 [eluser]cahva[/eluser] Just check the apache(or whatever webserver you're using) error log. The error is described there in detail. That should be the FIRST thing to do, not debug code when you dont know why the error is happening in the first place. 500 Internal server error when clicking links - El Forum - 04-04-2011 [eluser]keld[/eluser] thanks cahva, that's what I tried to this morning but on godaddy following their instructions to find the logs using their cr*ppy interface, well it's not where they say it is so I'm waiting for a response from them. 500 Internal server error when clicking links - El Forum - 04-04-2011 [eluser]InsiteFX[/eluser] Your anchor tags should be like this! Code: <?= anchor('recipes/recipe/'.$nameuri, $name, 'title="'.$name.'"') ?> InsiteFX 500 Internal server error when clicking links - El Forum - 04-04-2011 [eluser]keld[/eluser] @InsiteFX: oh really I didn't know, what's the difference ? is my method bad? I learn CI using the CI 1.7 book. Your method is prettier I'll update those links. Thanks! |