CodeIgniter Forums
form_open() - URL Redirect Error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: form_open() - URL Redirect Error (/showthread.php?tid=73130)



form_open() - URL Redirect Error - SunMeiTzu - 03-21-2019

Helloo, I was following the Tutorial off the main CodeIgniter page and when I tried to submit the form, I was directed to this URL:
http://localhost/index.php/news/localhost/index.php/news/create. I have some PHP experience and tried a few things to get the result I wanted, but nothing worked. If anyone can offer a suggestion it would be greatly appreciated.

I want to leave my original question in case anyone else comes across the same issue. I decided to check through the system files and didn't find the answer so I went back to the applications/config folder and opened config.php and set the $config['base_url'] = 'localhost'; to $config['base_url'] = '/'; . I am not sure if localhost was preset or if I set it, but I now get the result I am looking for.


RE: form_open() - URL Redirect Error - ciadmin - 03-21-2019

I am guessing you are serving from Apache, with the document root being your project folder?
It sounds like mod_rewrite is not enabled.


RE: form_open() - URL Redirect Error - SunMeiTzu - 03-22-2019

Thanks for your suggestion, but as it turns out I decided to check through the system files and didn't find the answer so I went back to the applications/config folder and opened config.php and set the $config['base_url'] = 'localhost'; to $config['base_url'] = '/'; . I am not sure if localhost was preset or if I set it, but I now get the result I am looking for.