0

I'm trying to migrate rewrite rules from apache to nginx. Can anybody explain what

RewriteRule ^api/.$ - [L]

does?

Rob
  • 344
  • 3
  • 15
andrekeller
  • 499
  • 2
  • 5

1 Answers1

1

Your comment is correct.

Basically:

[L] means that this should be considered the Last rule for anything matching this condition.

- when used as a target means "do nothing" or "accept as is".

^api/.$ is your regex. ^ means the beginning, $ means the end, and . means "any single character".

  • Thank you. Turns out in the subdirectory /api was a .htaccess file with further rules... This made me confused, as the rule in the question did apparently not behave as I would have expected. So this is kind of a passthrough that the .htaccess in the sub dir can rewrite the original request. – andrekeller Apr 15 '16 at 09:13