I'm working on some SEO optimization for our site and running into some confusing behavior. I think the the rewrite and proxypass configs are conflicting. Currently we have the below proxypass config:
ProxyPass /order/app1/ http://1.2.3.4/app1/
ProxyPassReverse /order/app1/ http://1.2.3.4/app1/
We're trying to implement some SEO rewrites for the URLs like below:
http://www.example.com/order/app1/category1/Abc123-3R19D3-abc-Product/123456
http://www.example.com/order/app1/category1/Abc-IgF-E-L-Item1-Item2-Item3-Item4-Product/12345
http://www.example.com/order/app1/category1/Abc-IgF-E-L-Item1-Item2-Product/AB1-12345
They'd like them rewritten to where /order/app1/category1 isn't required so just the last two sections are valid when they hit apache. I came up with the below rewrite rule and after testing realized I need to add the P flag since the content isn't hosted locally.
RewriteRule ^/(.*)-Product/(.*)$ /order/app1/category1/$1-Product/$2 [P,NC,L]
After I add that rule I get a 400 error. It seems like my proxypass and rewrite configs are stepping on each other. Do I need to modify my proxypass config to be more specific in order implement rules like this or am I going down the wrong path?