0

I need to convert the url

www.test.com/Test/My-address-Is-This to www.test.com/test/my-address-is-this.

I don't want to use perl script.

1 Answers1

2

You can use nginx/LUA :

http { ... server { ... location ~ [A-Z] { rewrite_by_lua 'ngx.exec(string.lower(ngx.var.uri))'; } ...

Or

http { ... server { ... set_by_lua $uri_lowercase "return string.lower(ngx.var.uri)"; location ~ [A-Z] { try_files $uri $uri/ $uri_lowercase $uri_lowercase/ =404; } ...
kundan kumar
  • 80
  • 1
  • 10
  • Do we have to do any setup to run nginx/luca. I have already nginx file. Just i have to keep this code or do i need to install anything? – Sarvani Annamraju Jan 13 '17 at 09:19
  • 1
    Please check the below URL for running lua: http://stackoverflow.com/questions/22193852/running-lua-in-nginx-config – kundan kumar Jan 15 '17 at 06:49