Search code examples
apachehttp-redirectreverse-proxymod-proxyproxypass

Apache Proxypass escaping # encoding


I am trying to implement below proxypass in Apache(version 4.33) ProxyPass.conf file:

ProxyPass /test-web/test.cbbotm balancer://test-cluster/test/testhelpers/testhtml/test.html#/testfunctionality

My problem is "#" is getting encoded to "%23" causing the failure.

I tried various approaches given below but nothing seems to be working:

  • Rewrite rule
  • ProxyPassMatch
  • using nocanon in ProxyPass

Any suggestion will be quite helpful. If there is any other alternative way that would be quite helpful as well.

Thanks Sanjay


Solution

  • I was able to fix it by excluding this url from proxypass and using apache redirect feature.

    ProxyPass /test-web/test.cbbotm ! Redirect /test-web/test.cbbotm /test-web/test/testhelpers/testhtml/test.html#/testfunctionality

    somehow redirect retain "#" and does not encode it.

    also got it worked with RewriteRule with [NE,R] parameters.