• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
htaccess on PHP fastcgi

#1
[eluser]JoostV[/eluser]
I had some problems with mod_rewrite on a shared hosting account (xxlwebhosting) where the hoster runs PHP as a fastcgi service.

When I tried to use CI's SEO URLs, I got an error 'No input file specified'.

I found the solution here: http://www.terencechang.com/2008/08/28/c...-apache-2/

This .htaccess works like a charm, notice the question mark behind index.php, that's the trick Smile Thought I'd share.

Code:
RewriteEngine On

# Existing files and directories remain accessible
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.* - [L]

# Redirect the rest
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [QSA,L]

#2
[eluser]Phil Sturgeon[/eluser]
We've had to do this in PyroCMS for a while now. To get your .htaccess working for both, try this snippet instead of the last line:

Code:
<IfModule mod_php5.c>
        RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>

    <IfModule !mod_php5.c>
        RewriteRule ^(.*)$ index.php?/$1 [L]
    </IfModule>

#3
[eluser]JoostV[/eluser]
Works like a charm, thanks!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.