• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Removing index.php from URLs....

#1
[eluser]Lee Mc[/eluser]
Hi,

I know this really, really shouldn't be that difficult, but it's managed to ruin my entire day. I give up, I need help!

I've set up a site using CI (latest build) and whilst i'm at the stage where I can browse the root of the CI site without "index.php", I can't access any of my other controllers without getting a 404. The only way I can get the pages to load is by using "index.php"...

I've set my "index page" in config.php as blank.
Mod_rewrite is set up on my server.
I took the sample .htaccess code from this site, which is as follows:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

For some reason, when I add the above .htaccess to the root of my CI site, I then get a 404 on my home page too, unless I specify "index.php". I realise this is probably me being ill-educated about .htaccess files, and i'm clearly missing something (perhaps a few brain cells). Any ideas would be appreciated...

Oh, and here's the URL of the CI version of my site: http://www.november10th.co.uk/codeigniter/


Thanks...

#2
[eluser]sukar[/eluser]
i don't know about .htaccess but check this one: http://www.ellislab.com/codeigniter/user...oting.html
it says you should change $config['index_page'] = "index.php"; to this
$config['index_page'] = "index.php?"; the difference is the addition of “?”.

#3
[eluser]Lee Mc[/eluser]
Thanks for the suggestion. I gave it a try but no joy...

#4
[eluser]BravoAlpha[/eluser]
Mine looks like this:
Code:
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /~bravoalpha/ci/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

#5
[eluser]sukar[/eluser]
try this one: http://codeigniter.com/wiki/mod_rewrite/

#6
[eluser]Lee Mc[/eluser]
Yeah, got there in the end, thanks!

I think the fact that I didn't really understand how mod_rewrite was working was the main problem...


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.