I
I
Ilya Petrov2020-12-22 00:18:58
Nginx
Ilya Petrov, 2020-12-22 00:18:58

How to convert apache RewriteRule .htaccess to nginx?

How to convert to nginx and where to embed? location / server
Opening site.com/page.php files as site.com/page/

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([0-9,a-z,-]+)/$ $1.php

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Dmitriev, 2020-12-22
@SignFinder

https://winginx.com/ru/htaccess

K
ky0, 2020-12-22
@ky0

Paste into that piece of the config where you want these rules to work. If I understand correctly, your rule can be replaced with a try_files directive .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question