E
E
exxagw2015-10-11 23:38:01
PHP
exxagw, 2015-10-11 23:38:01

How to remove slash at the end of url in nginx?

Now I'm using this function:

location ~ /$ {
  rewrite ^/(.*)/$ /$1 permanent;
}

But when you enter the site.ru/admin admin panel, it gives a cyclic redirect. How to fix?
and at the same time redirect from site.ru/index.php, site.ru/index.html, site.ru/index.htm, site.ru/index redirect to site.ru

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nurlan, 2015-10-12
@daager

M?
try_files $uri $uri/ /index.php;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question