there is an expression that adds a slash at the end of the url, it acts and the slash adds, and to the pictures too,

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

Question: how to exclude images (* .jpg, * .png) from this rule?

image addresses

.ru / files / 1769_content_img.jpg

I myself found how to remove some pages from the (other) rule’s actions, but this is probably not the case:

 rewrite ^/((?!install|admin|administrator).*)/$ /$1 permanent; 

Need your help, thanks!

    1 answer 1

    So try:

     rewrite ^(?!.+\.(?:jpe?g|png|gif)$)(.*[^/])$ $1/ permanent; 

    At first, we look ahead so that there are no jpeg, jpg, png, gif extensions at the end, and then there is a check for the absence of a slash with the capture of the entire line.

    • Everything worked fine, thanks! - VBugaenko