Page 1 of 1

Force Lowercase URL for Reverse Proxy on Ubuntu Apache Server

Posted: July 26th, 2018, 4:25 am
by rjames
How can I rewrite a request that comes in so that it is all lowercase? I've looked around and some answers were to use the rewrite Module but those weren't for the specific case of using a reverse proxy.

What I would want is for a request that comes in like this:

mywebsite/SomeApPlIcAtIon

to be converted to this:

mywebsite/someapplication/

Any Suggestions?

UPDATE:

I've got it setup with what I assume should be correct, my httpd.conf looks like this:

servername localhost
RewriteEngine on
RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 9
RewriteMap lc int:tolower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lc:$1} [R=301,L]
My reverse proxy is setup in a file in conf.d called sabnzbd.conf as such:

ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
ProxyPass /sabnzbd/ 192.168.21.21:9999/sabnzbd/
ProxyPassReverse /sabnzbd 192.168.21.21:9999/sabnzbd/
In my enabled-sites, my 000-defailt I have all AllowOverride set to All

When I go to 192.168.21.21/sabnzbd/ it works just fine.

When I go to 192.168.21.21/SABNZBD/ I get a 404. The rewrite rule doesn't work.

When I go to my rewrite log file to check it out, there is no data.

What is going wrong?

Re: Force Lowercase URL for Reverse Proxy on Ubuntu Apache Server

Posted: July 26th, 2018, 4:44 am
by sander
... how is this a sabnzbd specific question?