Codeigniter Index.php Issues

Web hosting discussion, programming, and shared and dedicated servers.
2 posts Page 1 of 1
by Rick Wiltsie » Thu Aug 02, 2012 10:23 am
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.
by Rick Wiltsie » Thu Aug 02, 2012 10:40 am
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. :)
2 posts Page 1 of 1

Who is online

In total there are 23 users online :: 0 registered, 0 hidden and 23 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 23 guests