Redirect strips trailing slash |
[eluser]matt.asbury[/eluser]
I have a redirect in my script which keeps stripping the trailing slash: Code: redirect("/backoffice/personnel/" . $this->input->post('id') . "/view/success/"); If I use the classic header redirect: Code: header("Location: /backoffice/personnel/" . $this->input->post('id') . "/view/success/"); Surely this points at the function itself. Any thoughts? Matt
[eluser]matt.asbury[/eluser]
It's ok guys, I traced the function through the framework and found that the trailing slash was being stripped in site_url() in the Config.php file of system/libraries: Code: $suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix'); Code: $config['url_suffix'] = "/"; Thanks
[eluser]matt.asbury[/eluser]
I understand why you would say that but that doesn't apply in codeigniter does it? Each segment of the URL makes up /class/function/as/many/variables/as/you/need/. I add the trailing slash to give the URL a complete look as some users will see the final variable and expect to see something else there - .html, .php, .asp, etc.
[eluser]sehummel[/eluser]
I tried adding the "/" to the config URL path and it doesn't get added. Actually, nothing does. I tried ".html" and it wasn't tacked on, either. What am I doing wrong?
[eluser]Sheldon[/eluser]
Try adding this to your .htaccess file. (if you dont have one, add it, if your on windows, suck ) Code: RewriteCond %{REQUEST_URI} !(.*)/$ Mine looks similar to: Code: Options +FollowSymLinks
[eluser]Unknown[/eluser]
Thank you for the suggestion. I'll let you know if it Portfolio Recovery works. |
Welcome Guest, Not a member yet? Register Sign In |