We have several SEO pages like:
http://www.example.com/PageOne.html
Which we redirect in config like:
location = /PageOne.html {
rewrite ^/(.*) /seo.php?id=1 last;
}
Problem is if a user access this page by typing:
http://www.example.com/pageone.html
“Page Not Found” error is displaying. There are approximate 500+ seo pages. How to write rule for nginx to ignore case sensitivity in url? I want a common solution for all url.
2
Answers
This solved my issue. Sad to say that there is not many articles related to these issues, even nginx doesn't provide user friendly Help/Tutorials.
Hope this helps!
Specifically for
PageOne.html
, you can do the following:If you have multiple URIs which need to be redirected, it appears the best option is to use Perl:
If you have hundreds of unique URIs which would involve many
location
blocks as above, I’d consider changing your application to handle lowercase URIs rather than expecting the webserver to handle the lowercase conversion.