CodeIgniter Forums

Full Version: Removing index.php?/ for CI running under PHP4 with FastCGI
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Todd S[/eluser]
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. http://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. http://www.domain.com/ci -Doesn't work. Apache 404 error -> "The requested URL /index.php/ was not found on this server."

3. http://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:

Code:
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.

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

Anyone have any clues?

El Forum

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

El Forum

[eluser]Todd S[/eluser]
[quote author="whidbey" date="1187297106"]RewriteEngine on
RewriteCond $1 !^(index\.php|images|assets|robots\.txt)
RewriteRule ^(.*)$ /youfolder/index.php/$1 [L][/quote]

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.

El Forum

[eluser]Todd S[/eluser]
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?

El Forum

[eluser]whidbey[/eluser]
so use REQUEST_URI,same with meSmile

El Forum

[eluser]Todd S[/eluser]
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.

El Forum

[eluser]whidbey[/eluser]
??

El Forum

[eluser]RaZoR LeGaCy[/eluser]
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

El Forum

[eluser]socs[/eluser]
I endedup having to use the QSA option to get it to work. This is the rule I'm using...

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [QSA,L]

El Forum

[eluser]John Fuller[/eluser]
For anyone coming across this thread, here is what worked for me.