I am a newbie. I would like to know how to convert apache rewrite to nginx. For example, how to convert the following apache rules:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !dispatch\.php$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* dispatch.php [L,QSA]
</IfModule>
世界只因有你2017-05-16 17:05:01
It’s simple. Understand your Apache httpd rules, and then write its functions using nginx rules. It’s almost the same thing as translation.
Your rule means that if the accessed URI does not end with dispatch.php
and the accessed file does not exist, then it will be redirected to dispatch.php. You can write this directly in nginx:
try_files $uri /dispatch.php;