S
S
Serg2017-04-08 05:32:22
Nginx
Serg, 2017-04-08 05:32:22

Nginx Rewrite how to exclude a directory?

All the best.
To add a slash at the end of a query excluding queries with a dot, do this:

rewrite ^([^.\?]*[^/])$ $1/ permanent;

Please tell me how to exclude the bitrix directory from the rewrite rule?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Serg, 2017-04-08
@sergrych

In general, I did this:

if ($request_filename !~ bitrix/.+) {rewrite ^([^.\?]*[^/])$ $1/ permanent;}
if ($request_filename ~ bitrix/.+) {rewrite ^([^. \?]*[^/])/$ /$1 permanent;}

I don't know how true / but how it works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question