Forum Moderators: phranque
Should I redirect or proxy? I know mod_rewrite should NOT be used unless there is no other way. They configured #1 in our lower environments. I am config code reviewing for QA/PROD and I think what they have done is bad. It can be served by #2 or #3.
1) RewriteRule ^/travel/itinerary.html$ /a/res.html [R,L]
2) <Location /travel/itinerary.html>
ProxyPass balancer://cluster/a/res.html
ProxyPassReverse balancer://cluster/a/res.html
</Location>
3) Redirect 302 /travel/itinerary.html /a/res.html
Is proxying (#2) the best practice solution? Redirect (#3) would generate another client HTTP request and double request traffic, right?
Later on down in the conf they have placed the following to pick up the #1 /a rewrite REDIRECT and send down stream to the new backend app. This is also required if I use #3 too.
RewriteRule ^/a(/)?$ balancer://cluster%{REQUEST_URI} [P,QSA,L]
RewriteRule ^/a/(.*)$ balancer://cluster%{REQUEST_URI} [P,QSA,L]
So I could proxy it directly OR instruct it using a Redirect directive, which the above RewriteRule will match and proxy anyway.
thoughts?
Cheers,
D
and I think what they have done is bad.
For a simple redirect, use the redirect directive provided by mod_alias, unless you've a conflict with other RewriteRules.
Later on down in the conf they have placed the following to pick up the #1 /a rewrite REDIRECT and send down stream to the new backend app.
So I could proxy it directly OR instruct it using a Redirect directive, which the above RewriteRule will match and proxy anyway.