Welcome Guest, Not a member yet? Register   Sign In
Stupid Simple .htaccess problem
#1

[eluser]johnmchilton[/eluser]
Hi there, I have a CI install at http://www.example.com/ci/

So, pages look like http://www.example.com/ci/index.php/controller/function

I am wondering what to put in the .htaccess file to remove the index.php from this. Does anybody know? Thanks.
#2

[eluser]jamie young[/eluser]
Follow the steps listed at http://codeigniter.com/wiki/mod_rewrite/

That should get it going for you.
#3

[eluser]johnmchilton[/eluser]
The problem is that I know how to do steps 2-5, but I don't know how to get the desired effect with a .htaccess file, and all the tutorials online seem to be written for people who already know how to do it. Can somebody point me in the right direction?
#4

[eluser]stdio[/eluser]
I am also interested in it. Any help for us?
#5

[eluser]inet411[/eluser]
Here is what I use:

Code:
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?$1 [L,QSA]

Works for me. Hope it helps you.
#6

[eluser]stdio[/eluser]
Thank you inet! This is what I needed. Works perfectly! Smile
#7

[eluser]johnmchilton[/eluser]
I ended up editing my apache configuration to add a <Directory /var/www/ci/> with:

RewriteCond $1 !^(index.php|media)
RewriteRule ^(.*)$ index.php/$1 [L]

Three cheers for workarounds, am I right?




Theme © iAndrew 2016 - Forum software by © MyBB