Re: why my php file in subdirectory doesn't work?

Edho Arief edho at myconan.net
Fri Jan 6 10:36:25 UTC 2012


On Mon, Oct 17, 2011 at 11:19 PM, suttles <nginx-forum at nginx.us> wrote:
> Update on my problem.... if the URL is typed this way
> http://www.domain.com/subdirectory it will not pull up the site, but
> when the URL is typed http://www.domain.com/subdirectory/ the site comes
> up immediately. How to do force nginx to put the trailing slash onto the
> subdomains?
>

either

location = /subdirectory {
  rewrite ^ $uri/?$args permanent;
}

or

try_files $uri $uri/ =404;

or

symlink in root instead of redefining root in location /subdirectory/

or

location /subdirectory {
  ...
}
##note that this one kind of not what you expect.
/subdirectorysomething will match this location.

-- 
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



More information about the nginx mailing list