3

I'm in the process of migrating from Apache to nginx and have used http://winginx.com/en/htaccess to migrate the rewrite rules. I'm trying to understand what the translated ones mean though and I can't find any documentation on it. Here's an example:

if (-e $request_filename){
    rewrite ^(.*)$ /index.php break;
}

I believe -f checks if a file exists, and -d checks if a directory exists, but what about -e? And where might I find these in the documentation? Thank you!

5

According docs:

  • checking of a file existence with the -f and !-f operators;
  • checking of a directory existence with the -d and !-d operators;
  • checking of a file, directory, or symbolic link existence with the -e and !-e operators;
  • checking for an executable file with the -x and !-x operators.
  • 2
    The docs don't say much beyond what you pasted, but these appear to be modeled after the UNIX/POSIX "test" utility (man test). – Gerald Combs May 11 '15 at 16:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.