0

So I have been trying and failing at re-write conditions for a site that multiple subdomains for its site

The gist is that each market must direct and display code differently do to regulations

so

https://market1.product.com/    
https://market2.product.com/

Should redirect to

https://market1.product.com/product-alias
https://market2.product.com/product-alias

Same alias, different subdomains

So I have tried setting the proxypass and reverseproxy pass and various iterations of rewrite cond and rules like so

this was an attempt to make root just go to either of the subdomains

proxypass / https://market1.product.com/product-alias
proxypass / https://market2.product.com/product-alias

This gives me a Proxy 502 error

This was an attempt to capture the site and pass the site to the alias

RewriteCond %{HTTP_HOST} ^([^\.]+)\.product\.com
RewriteCond /product-alias
RewriteRule ^(.*) /%1/$1 [L]

This just puts the alias about 7 times after the site name

For context the biggest thing is I am more of developer for backend things so I tend to not mess with apache conf files but have the most experience amongst the group so I was voluntold to work with it, and all of this is most likely my lack of understanding of apache httpd and also not fully understanding the directives that come with mod_proxy and mod_rewrite

I hope this makes sense and follows all the rules and appreciate any feedback on the type of question and context I should add in the future, I am mostly a lurker and use the site throguh google searches of errors and not really an architect

Craig
  • 1
  • 1
  • ProxyPass is completely wrong in this context, it doesn't do redirects. – Gerald Schneider Mar 16 '22 at 05:55
  • Thanks for the reply, and info @GeraldSchneider i figured one of two or both were not the right choice. That answer has similar contexts and think i can combine my rewrites cond for subdomain with teh query string cond in that answer and make it work. My outage window for prodzone has closed so I will update with an answer tomorrow(yeah only env that have this set up is in stage and prod both are outage tickets.....enterprise Architecture for ya) – Craig Mar 16 '22 at 06:04

0 Answers0