Score:0

Apache Redirect Dynamic Subdomain to Dynamic URL

ng flag

I'm trying to create the following redirection rules for my website:

http://clientA.domain1.com => https://domain2.com/list/clientA

And also:

http://clientA.domain1.com/portfolio/an-example-post-353 => https://domain2.com/portfolio/an-example-post-353

Real world working example:

I've seen it in active on Etsy, if you visit:

https://bear107shop.etsy.com/listing/935679781/face-mask-bear-pride-sitting-teddy-bears

it redirects to

https://www.etsy.com/listing/935679781/face-mask-bear-pride-sitting-teddy-bears

It also needs to redirect http > https and www > non-www. (so https://...)

Bonus question: Is there a method whereby I don't have to create multiple htaccess files per subdomain? Instead just have a primary htaccess file within the domain1.com root

Edit I've attempted it myself here: https://htaccess.madewithlove.be?share=e6d5398a-335e-4d5f-b2ef-73d8f3bcdfb4 but despite it passing the check here, I get a 404 error.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.