regex - NGINX Redirect Loop for a single page -
i have nginx webserver , trying redirect page
www.example.com/newsletter
to
www.example.com/blog/category/newsletter
but redirect rule have matching both locations , causing redirect loop. how can make rule ignore /blog/category page while still redirecting /newsletter page?
the redirect rule using is:
rewrite ^/newsletter$ https://www.example.com/blog/category/newsletter permanent;
not @ regex , not sure need use final page excluded redirect loop.
i wouldn't handle rewrite, try instead
location = /newsletter { return 301 $scheme://www.example.com/blog/category/newsletter; }
Comments
Post a Comment