URL Rewriting with redirection |
[eluser]tzultacah[/eluser]
I was having an issue with URL rewriting with the "redirect" function. I am using the .htaccess modifications listed in the User Guide, which works great when redirection is not taking place. What was happening was this: When I clicked on links the URL rewrite was working fine, but when I used the redirect('stuff/to_thing') function, index.php was getting back into my URL. So I created a helper file "My_url_helper.php" and over-rode the redirect function as follows: Code: function redirect($uri = '', $method = 'location', $http_response_code = 302) { Code: default : header("Location: ".site_url($uri), TRUE, $http_response_code); Code: default : header("Location: ".preg_replace('#index.php\/#', '', site_url($uri)), TRUE, $http_response_code); |
Messages In This Thread |
URL Rewriting with redirection - by El Forum - 03-20-2009, 09:09 AM
URL Rewriting with redirection - by El Forum - 03-20-2009, 09:13 AM
URL Rewriting with redirection - by El Forum - 03-20-2009, 09:34 AM
|