Lowercase URLs

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.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,230181,230181#msg-230181

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

Can’t we get this functionality without using lua-nginx-module?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,230181,230270#msg-230270

On 2012-08-29 13:11, ShreyasPrakash wrote:

Can’t we get this functionality without using lua-nginx-module?

AFAIK Nginx does support this out of the box, i.e. there’s nothing like
the internal functions tolower/toupper of RewriteMap in Apache HTTP (see
http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#rewritemap). If
you prefer Perl over Lua, go with the Perl module.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs