0

there! I use this .htaccess file in a project:

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

It works well in Apache 2.2

Recently I started to use Zend Server CE , the ReWrite Rule didn't work ! And this works:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

This is what Apache's document say:

The variables SCRIPT_FILENAME and REQUEST_FILENAME contain the same value - the value of the filename field of the internal request_rec structure of the Apache server. The first name is the commonly known CGI variable name while the second is the appropriate counterpart of REQUEST_URI (which contains the value of the uri field of request_rec).

Anyone can figure out why? Appreciate!

Artefacto
  • 96,375
  • 17
  • 202
  • 225
karelrooted
  • 11
  • 1
  • 2
  • No idea. Appears to contradict the Apache documentation, but since you're not using a vanilla apache, anything goes. Try to enable logging. – Artefacto May 29 '10 at 15:25

1 Answers1

1

Sorry,EveryOne! I made a mistake, this will work:

   `RewriteEngine On`
   `RewriteCond %{SCRIPT_FILENAME} !-f`
   `RewriteCond %{SCRIPT_FILENAME} !-d`
   `RewriteRule ^(.*)$ /index.php  [L]`

It appears that FastCGI process url like index.php/anything_here as a true url , not index.php with pathinfo.

karelrooted
  • 11
  • 1
  • 2