Mod Proxy | Trailing Slash Issue

If you are using mod_proxy in apache and facing the trailing slash issue i.e. an extra slash is appended after the URL. For instance, if you are hitting http://mydomain.com and it  is getting redirected to http://mydomain.com// then make sure you don’t have a configuration like this.

ProxyPass "/" "http://mydomain.com"
ProxyPassReverse "/" "http://mydomain.com/"

It can be easily fixed by having the trailing slash in both the statements i.e.

ProxyPass "/" "http://mydomain.com/"
ProxyPassReverse "/" "http://mydomain.com/"

I faced this problem recently in one of my projects. I found this fix so shared it.

Hope it helps !! 🙂

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s