TransWikia.com

Rewrite with [P] flag lands in wrong vhost

Server Fault Asked by NthDegree on November 24, 2021

I have a an old and a new site with 2 different urls, I’m trying to redirect the old urls to the new one with the proxy [p] flag. It works as expected, but it’s landing in the wrong virtual host because it has the old url as host.

Sites:

  • myoldsite.com
  • mynewsite.com

Redirects:

RewriteRule ^(.*)/testtest$ https://mynewsite.com/content/testtest? [P]

The redirect should only trigger if i’m opening myoldsite.com, not when i’m visiting mynewsite.com.

The request is successfully redirected, but it uses the VirtualHost configuration of myoldsite.com because the host is set to it. I need it to be set to mynewsite.com to use the correct VirtualHost.

How could I achieve this?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP