This rule is based on the rereite rules of the Blue Dolphin shopping guide program.
I want to convert the following .htaccess rules into nginx rules, please help...
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L]
</IfModule>
A more accurate statement is: how to convert Apache's rewrite rules into nginx's. ——.htaccess is just a means and need not be mentioned too much, but it must be emphasized that the module involved is rewrite, because if it is another module, nginx may not have corresponding functions.
Two ideas:
The above rule means that if the file or folder corresponding to the URI does not exist, rewrite it. Apache's %{REQUEST_FILENAME} corresponds to $uri in nginx, so your above rules can be configured with the following try_files
The function of try_files is to check whether the files exist in order and return the first found file or folder (a trailing slash indicates a folder). If all files or folders are not found, an internal reset will be performed. Directed to the last parameter.
$args represents the parameters in the url.
Apache rewrite rules converted to Nginx
http://www.51ask.org/apache2n...