Answer the question
In order to leave comments, you need to log in
How to convert apache2 mod_rewrite rules to nginx?
This is the rule:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((?s).*)$ index.php?_url=/$1 [QSA,L]
</IfModule>
Answer the question
In order to leave comments, you need to log in
try_files $request_filename /index.php?_url=/$1;
Well, do not forget to describe the location for processing index.php.
And a question on the answer "How to transform" - nevertheless "read the documentation". Well, or re-ask the question in the spirit of "transform the rules."
It is not necessary to convert (literally, each directive).
nginx offers the try_files directive to solve such problems, it is much more elegant than such a crutch for Apache.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question