Francis Daly
January 18, 2011 02:32PM
On Tue, Jan 18, 2011 at 01:45:35PM -0500, uid_b wrote:

Hi there,

> I'm switching from Apache to Nginx/fcgi and I'm having a small issue
> while attempting to setup the applications rewrite rules.
>
> The code handles routes via the use of PATH_INFO, e.g.,
> example.com/foo/bar/ will be routed to example.com/index.php/foo/bar/

> [code]
> location ~ \.php$ {

This location matches a url that ends in the four characters ".php".

> [/code]
> With '__rewrite_log on__', the url's appear to be routing properly:
> [code]
> [error]: *2 open() "/var/www/public/index.php/test" failed (20: Not

This url is "/index.php/test". Note that is does not end in the four
characters ".php", and so will not be handled by the previous location
block.

> However, it appears to be looking for the directory "test". How can I
> force it to request index.php, passing '/test' to the script?

Change the "location" to match what you want it to match.

As a quick test, make it just match "php" to confirm that that works as
you want. And then tighten the config so that it won't match things you
don't want it to -- perhaps "starts with /index.php/" is appropriate?

Good luck,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx, PATH_INFO, and url-rewriting: i must be missing something.

uid_b January 18, 2011 01:45PM

Re: Nginx, PATH_INFO, and url-rewriting: i must be missing something.

Francis Daly January 18, 2011 02:32PM

Re: Nginx, PATH_INFO, and url-rewriting: i must be missing something.

uid_b January 20, 2011 05:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 302
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready