nginx case insensitive URL redirection
nginx, redirect, regex
Solution
Use `(?i)` to match case-insensitively - http://perldoc.perl.org/perlretut.html
Location block is not necessary. Try this.
rewrite (?i)^/WapsiteDataFetch(.*) http://images.xample.com/xyz/images$1 permanent;
Problem
I want to do case insensitive URL redirection in nginx. Below is my code. ``` location ~* WapsiteDataFetch{ rewrite WapsiteDataFetch(.*) http://images.xample.com/xyz/images$1 permanent; } ``` In the above case, `www.example.com/WapsiteDataFetch` is redirected properly to `http://images.xample.com/xyz/images`. However, the URL `"www.example.com/WAPSITEDATAFETCH"` is not redirected properly. Even if I change a single character, it is giving a 404 error. I have tried many blog posts and have seen many post from Stack Overflow and many of them have suggested "~*", but in my case it was not helping me. How can I fix this?