Prevent canonical redirect for staging (pre-production) domain only

Question

We have a single wordpress instance that is accessible in two different domains: https://example.com/wp/ and https://staging.example.com/wp/.

The first is the canonical site, but the second should be also accessible. The problem is that wordpress automatically do a 301 redirect to the canonical site.

That redirection is OK on most of the cases, so I don’t want to disable that entirely, I just want to prevent it on that specific domain, and if possible without touching too much code.

Is it possible to use the .htaccess file to modify the request making wordpress see it as coming from the canonical side (thus preventing the redirection)? I think that it can have the minimal impact, but may be is there any better alternative?

0
, eloyesp 2 years 2019-10-30T13:27:44-05:00 0 Answers 76 views 0

Leave an answer

Browse
Browse