Part of the EllisLab Network
   
 
htaccess
Posted: 29 July 2010 11:50 PM   [ Ignore ]  
Grad Student
Rank
Total Posts:  44
Joined  07-28-2010

im not sure if im doing this right…but im trying to remove the index.php from needing to be present during controller calls,

reading through the user guide, i see that in order to do that, you add the following to the htaccess

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

however for some reason, everytime i add the following code, i get a 500 server error when i try to view my site (on a local machine, using apache)

anything im doing wrong?

Profile
 
 
Posted: 30 July 2010 12:38 AM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  22
Joined  12-30-2008

Check out this out for a new updated htaccess.

For this one though, your htaccess is fine, you need to edit your config.php

$config['index_page'"index.php"

should be changed to

$config['index_page'""


Try using this minor adjustment if that one is not working

<IfModule mod_rewrite.c>
    
RewriteEngine on
    RewriteCond 
$!^(index\.php|images|robots\.txt)
    
RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule

Notice the ? after index.php

Profile
 
 
Posted: 30 July 2010 12:33 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  1
Joined  07-12-2010
haydenk - 30 July 2010 04:38 AM

Check out this out for a new updated htaccess.

For this one though, your htaccess is fine, you need to edit your config.php

$config['index_page'"index.php"

should be changed to

$config['index_page'""


Try using this minor adjustment if that one is not working

<IfModule mod_rewrite.c>
    
RewriteEngine on
    RewriteCond 
$!^(index\.php|images|robots\.txt)
    
RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule

Notice the ? after index.php

Could you please explain what the ? mark after index.php indicate, why is this required

Profile
 
 
Posted: 30 July 2010 12:58 PM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  22
Joined  12-30-2008

Honestly, it’s been awhile since I tried that addition, so I do not recall the reason why it works.

I just remember when I switched web hosts, all of a sudden my rewrite rules were not working and when I googled for information, this was one of the suggestions that was made and it worked.

Sorry.

Profile
 
 
Posted: 30 July 2010 04:13 PM   [ Ignore ]   [ # 4 ]  
Grad Student
Rank
Total Posts:  44
Joined  07-28-2010

well that worked…but it broke my methods..haha

for some reason,methods didnt work after that..

Profile
 
 
Posted: 30 July 2010 04:15 PM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  22
Joined  12-30-2008

There is actually a whole new set of rewrite rules CI put out lately too. It’s more like wordpress now. Check out the link I posted in the first reply.

Profile
 
 
Posted: 31 July 2010 01:58 PM   [ Ignore ]   [ # 6 ]  
Grad Student
Rank
Total Posts:  44
Joined  07-28-2010

yea i followed them all except for 3…it was a bit confusing and i wasnt sure what that as asking for.
not sure ifthat was the problem.

but when i applied 1-2,4+5 from the link you provided, it DID remove the index.php, but my functions/methods didnt work using the /function/ methods.

Profile