Welcome Guest, Not a member yet? Register   Sign In
Remove index.php from URL
#1

Following the instructions at http://www.codeigniter.com/userguide3/general/urls.html, I can get the index.php removed from the URL of regular links, e.g., http://www.foo.com/index.php, using this .htaccess entry:
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Now, there is a scenario where there is a redirect inside of a controller that should go to something like http://www.foo.com/bar/foo However, the redirect goes to http://www.foo.com/index.php/bar/foo instead. Directly typing http://www.foo.com/bar/foo works fine. It's just the redirect that adds the index.php for some reason.

The redirect is very simple:
PHP Code:
   public function index() 
 
   
    
redirect('/foo/bar''data');
 
   

How do I can get rid of the index.php in the URL of a redirect? Thanks in advance!
Reply


Messages In This Thread
Remove index.php from URL - by eci35 - 04-30-2015, 12:01 AM
RE: Remove index.php from URL - by wolfgang1983 - 04-30-2015, 12:10 AM
RE: Remove index.php from URL - by eci35 - 04-30-2015, 12:25 AM
RE: Remove index.php from URL - by gard_olsen - 04-30-2015, 07:03 AM
RE: Remove index.php from URL - by CroNiX - 04-30-2015, 08:01 AM
RE: Remove index.php from URL - by eci35 - 04-30-2015, 12:25 PM
RE: Remove index.php from URL - by ivantcholakov - 04-30-2015, 01:01 PM
RE: Remove index.php from URL - by eci35 - 04-30-2015, 01:38 PM
RE: Remove index.php from URL - by ivantcholakov - 04-30-2015, 01:54 PM
RE: Remove index.php from URL - by CroNiX - 04-30-2015, 02:12 PM
RE: Remove index.php from URL - by madaan_tushar - 05-25-2015, 07:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB