Forum Moderators: phranque
RewriteEngine On
SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerName Off
SSLProxyCheckPeerCN Off
RequestHeader set X-Forwarded-Proto "https"
RewriteCond %{REQUEST_URI} ^/(xy-test|ab-pro)$
RewriteRule ^/(.*)$ https://www.actual.com/$1/ [R=301,L]
RewriteRule ^/xy-test/?(.*)$ https://www.application.com/ab-pro/$1 [L,P]
RedirectMatch ^/$ https://www.actual.com/xy-test [edited by: phranque at 4:58 am (utc) on Mar 30, 2017]
[edit reason] unlinked urls for clarity [/edit]
Use of the [P] flag implies [L]
when there are Redirect and RewriteRule directives in the same scope, the RewriteRule directives will run first, regardless of the order of appearance in the configuration file
Tomcat is doing a 302 redirect which i can see in the response header to the below
This directive lets Apache httpd adjust the URL in the Location, Content-Location and URI headers on HTTP redirect responses. This is essential when Apache httpd is used as a reverse proxy (or gateway) to avoid bypassing the reverse proxy because of HTTP redirects on the backend servers which stay behind the reverse proxy.