Part of the EllisLab Network
   
 
Removing index.php?/ for CI running under PHP4 with FastCGI
Posted: 16 August 2007 10:33 AM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  207
Joined  2004-06-07

This is kind of fork off a thread I started yesterday, but I’ve just solved the initial problems which formed the context of that thread.

Anyway, I’ve got CI running under PHP4 via FastCGI in a special directory with an .htaccess file, but I’m seeing three behaviors when I try to access the default controller or “Welcome to CodeIgnitor” message.

1. www.domain.com/ci/index.php?/ - This works, I see the Welcome message and even the correct 4.4.2 phpinfo() which I’ve embedded.

2. www.domain.com/ci -Doesn’t work. Apache 404 error -> “The requested URL /index.php/ was not found on this server.”

3. www.domain.com/ci/index.php - Doesn’t work. 404 Page not found from CI.

I’ve tried lots of different Rewrite Rules in my .htaccess file, but at this point I can live with index.php in the URL, if I can resolve the 404s and eliminate the trailing “?/”.

The only thing in my .htaccess file now is:

AddType application/x-httpd-fastphp .php
Action application
/x-httpd-fastphp /cgi-bin/php-cgi

I’ve tried a bunch of different settings in config, namely with $config[’index_page’], but nothing seems to work. Everything is pretty much in a vanilla state at this time.

e.g. $config['index_page'] = "index.php";

Anyone have any clues?

Profile
 
 
Posted: 16 August 2007 10:45 AM   [ Ignore ]   [ # 1 ]  
Grad Student
Rank
Total Posts:  41
Joined  2007-05-17

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

 Signature 

l[url=http://www.angeltt.com

]MySite study from here with CodeIgniter--for my angel[/url]

Profile
 
 
Posted: 16 August 2007 11:18 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  207
Joined  2004-06-07
whidbey - 16 August 2007 10:45 AM

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

That didn’t work, but I’m not even that concerned with Rewrite rules unless they help resolve the 404s and the trailing “?/”.

Perhaps I should also mention I’m running under https: but I’m presuming that’s not an issue.

Profile
 
 
Posted: 16 August 2007 12:26 PM   [ Ignore ]   [ # 3 ]  
Lab Assistant
RankRank
Total Posts:  207
Joined  2004-06-07

Having much better success now just by changing the URI setting to ‘REQUEST_URI’.

I can hit just the directory and index.php without any 404s, but I still have to carry the “?” into the controllers.

e.g. domain.com/ci/index.php?/welcome

Wondering if that’s just the way it’s going to have to work under FastCGI?

Profile
 
 
Posted: 16 August 2007 10:09 PM   [ Ignore ]   [ # 4 ]  
Grad Student
Rank
Total Posts:  41
Joined  2007-05-17

so use REQUEST_URI,same with me:)

 Signature 

l[url=http://www.angeltt.com

]MySite study from here with CodeIgniter--for my angel[/url]

Profile
 
 
Posted: 16 August 2007 10:16 PM   [ Ignore ]   [ # 5 ]  
Lab Assistant
RankRank
Total Posts:  207
Joined  2004-06-07

Yep, REQUEST_URI was the way to go here. No 404s and I’ve been able to remove the trailing “?”.

On to the next problem I’m having ... the database autoload.

Profile
 
 
Posted: 16 August 2007 10:29 PM   [ Ignore ]   [ # 6 ]  
Grad Student
Rank
Total Posts:  41
Joined  2007-05-17

??

 Signature 

l[url=http://www.angeltt.com

]MySite study from here with CodeIgniter--for my angel[/url]

Profile
 
 
Posted: 25 August 2007 01:12 PM   [ Ignore ]   [ # 7 ]  
Grad Student
Rank
Total Posts:  56
Joined  2007-07-14

I had a prob that this post helped me with

I had a problem out of the blue with the default controller. It kept saying that the uri submitted was bad but it worked when I typed out the url into the browser.

I read this post and then went into the config file and changed the AUTO -> REQUEST_URI

Works like before again

Thanx guys

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 59087 Total Logged-in Users: 17
Total Topics: 70111 Total Anonymous Users: 1
Total Replies: 377919 Total Guests: 263
Total Posts: 448030    
Members ( View Memberlist )