0

How should I rewrite this htaccess rules to nginx kind of rules:

RewriteCond %{REQUEST_URI} !^/?puppy/index.php$
RewriteRule . /puppy/index.php

1 Answer 1

3

In nginx, you won't use a rewrite for this at all. You would use try_files instead. For example:

try_files $uri $uri/ /puppy/index.php;

Or, more likely, try_files along with a named location to handle PHP scripts.

This isn't something that should be done in isolation; it is an integral part of the entire server block and you should not consider it separately.

Not the answer you're looking for? Browse other questions tagged .