Question

I have a Java webapp running on tomcat displayed through an AJP connector. The app's source code is closed so I cant really move much to it. Issue is as following. When I signout of the app it takes me to a weird looking page. So I want to redirect that strange looking page via the httpd.conf to the sign up page.

The URL has this at the very end, so I identified the URL pattern and wrote a regular expression that matches the pattern , and then wrote it in the httpd.conf and httpd-ssl as well , but it takes no action.

This is what I wrote to the files mentioned above.

RedirectMatch permanent /(?:.*\&sso_signoff=yes) https://mydomain.org/

I believe the proper modules are loaded because if I type not valid regexp and then restart httpd it shows an error conceirning that. Does anyone have idea what I'm doing wrong?

Was it helpful?

Solution

Looks like you're matching query string which cannot be done in RedirectMatch. Use mod_rewrite instead:

RewriteEngine On

RewriteCond %{QUERY_STRING} &sso_signoff=yes [NC]
RewriteRule ^ https://mydomain.org/? [L,R=301,NE]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top