Page 1 of 1

Codeigniter Index.php Issues

Posted: Thu Aug 02, 2012 10:23 am
by Rick Wiltsie
I'm some issues with a Codeigniter project and am hoping someone can help me.

Currently I'm using an .htaccess to remove the index.php from the URL. Here is the file in its entirety...

Code: Select all

Action php-cgi /cgi-bin/php5
AddHandler php-cgi .php 
Options +FollowSymLinks 
Options -Indexes 
DirectoryIndex index.php 
RewriteEngine on 
RewriteCond $1 !^(index\.php|resources|images|css|js|robots\.txt|favicon\.ico) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
This has worked on other servers in the past for me, but doesn't appear to be working correctly as it doesn't properly redirect. Going to http://www.riverroadvineyards.com/new/index.php/page-1 produces the proper output, however http://www.riverroadvineyards.com/new/page-1 generates the following error...
The requested URL /opt/apache/conf/IP/179/209.204.175.179/new/index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I'm really baffled with this, and any help would be much appreciated. Thanks.

Re: Codeigniter Index.php Issues

Posted: Thu Aug 02, 2012 10:40 am
by Rick Wiltsie
I resolved this issue on my own. Thank you for anyone who took a gander.

The issue on my end had to do with the .htaccess not accounting for the directory the application rested in.

The RewriteRule should have been

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

instead of...

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

Thanks for letting me waste your time. :)