S
S
Sergey Brovko2018-10-11 20:48:13
Nginx
Sergey Brovko, 2018-10-11 20:48:13

How to properly convert .htaccess rules?

Hello, the question is of course stupid and banal, but unfortunately I did not find a working solution.
There is a .htaccess file with the following content:

Options -Indexes 

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?action=$1 [L,QSA]

With -Indexes it is clear autoindex off;
But what to do with the rest? Standard nginx + php-fpm. I can’t make the try_files rule correctly, either it doesn’t work, or it doesn’t work as intended (files that are in the root try to be processed by rewriting, even if they are loaded via a direct link)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2018-10-11
@xmoonlight

1. https://nginx.org/ru/docs/http/ngx_http_rewrite_mo...
2. https://gist.github.com/carlessanagustin/9509d0d31...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question