csg
August 28, 2012 09:56AM
On 2012-08-28 11:30, ShreyasPrakash wrote:
> Hi,
>
> I would like to know how to convert the URLs to lowercase. When
> somebody
> hits an URL ( irrespective of the case ), it should be converted to
> lowercase in the address bar.

With the help of lua-nginx-module (see
https://github.com/chaoslawful/lua-nginx-module)
it could look like this ...

location ~ "\p{Lu}" {
rewrite_by_lua 'return ngx.redirect(string.lower(ngx.var.uri),
ngx.HTTP_MOVED_PERMANENTLY)';
}

-cs

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Lowercase URLs

ShreyasPrakash August 28, 2012 05:30AM

Re: Lowercase URLs

csg August 28, 2012 09:56AM

Re: Lowercase URLs

ShreyasPrakash August 29, 2012 07:11AM

Re: Lowercase URLs

csg August 29, 2012 08:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 236
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready