Hi all, I hav difficulties creating rewrite rules for Zend_Controller_Router_Rewrite according to http://framework.zend.com/manual/en/zend.controller.router.html The apache rewrite rule was: RewriteEngine on RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php But when I ported this to nginx: location / { root /home/my_home/public_html; if ($request_filename !~ "\.(js|ico|gif|jpg|png|css)$") { rewrite ^(.*) index.php last; } index index.php; } It didn't work. I always received this error message when requesting an url (http://my-site.com/test/) from nginx: No input file specified. Please help. Thanks in advance.
on 07.11.2007 07:39
on 07.11.2007 07:47
On Wed, Nov 07, 2007 at 01:29:36PM +0700, Huan Truong wrote: > But when I ported this to nginx: > url (http://my-site.com/test/) from nginx: No input file specified. > > Please help. Thanks in advance. location / { fastcgi_pass ... fastcgi_param SCRIPT_FILENAME /home/www/scripts/php/index.php; ... } location ~ \.(js|ico|gif|jpg|png|css)$") { root /home/my_home/public_html; ... }
on 07.11.2007 07:52
On Wed, Nov 07, 2007 at 09:39:50AM +0300, Igor Sysoev wrote: > > RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php > > > > location ~ \.(js|ico|gif|jpg|png|css)$") { - location ~ \.(js|ico|gif|jpg|png|css)$") { + location ~ "\.(js|ico|gif|jpg|png|css)$") {
on 07.11.2007 08:16
Igor, it worked perfectly. Thank you! - Huan. PS: Btw,... ;-) Igor Sysoev wrote: > On Wed, Nov 07, 2007 at 09:39:50AM +0300, Igor Sysoev wrote: > >> On Wed, Nov 07, 2007 at 01:29:36PM +0700, Huan Truong wrote: >> >> location ~ \.(js|ico|gif|jpg|png|css)$") { > > - location ~ \.(js|ico|gif|jpg|png|css)$") { > + location ~ "\.(js|ico|gif|jpg|png|css)$") { > - location ~ "\.(js|ico|gif|jpg|png|css)$") { + location ~ "\.(js|ico|gif|jpg|png|css)$" {