Skip to main content
4 of 4
Added information about the missing mod_rewrite
vic
  • 101
  • 3

WP forwarding to wrong site address

I downloaded a whole WP install and moved it to a LAMP test environment in order to update it. The original site could be found under example.com, the test site should be under example.com.mytestdomain.com aka {testurl}. In order to achieve that, I created a local DNS record and I changed the site url as well as the home url in the WP dashboard to reflect this test domain.

I can access {testurl}/wp-admin fine, and both the site address as well as the home address are set to {testurl}, and not example.com.

Yet, when I try to access {testurl}, I am always being forwarded to example.com.

I'd be grateful for hints why this could be happening. I have no redirect plugins, (internal) DNS is set up correctly.

Update: In the end, it turned out I did not activate the mod_rewrite module in my httpd.conf which led to my permalinks being ignored on the test server.

After I corrected this mistake, I could correctly access {testurl}/postname but I was still being redirected to example.com when calling {testurl}.

As a next step, I directly called {testurl}/index.php. And this worked. And from that moment on, I can call {testurl} without being redirected.

Frankly, I'm not at all sure about how this last step solved the problem but it's gone now.

vic
  • 101
  • 3