Search code examples
phpwordpressplesk

Redirect/Bad Gateway issues with Wordpress and Plesk Site Preview


I'm facing some weird problems when trying to view my Wordpress website via Plesk site preview.

The preview url looks as follows: http://xxx.xxx.xxx.xxx/plesk-site-preview/example.com/xxx.xxx.xxx.xxx/

I already changed the base url of Wordpress (Settings -> General) to the url above.

Now, when accessing the url I can see the home page. But when I try to access any subsite, it results in an redirect loop:

AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error.

When I try to access http://xxx.xxx.xxx.xxx/plesk-site-preview/example.com/xxx.xxx.xxx.xxx/wp-admin/, I get an 502 Bad Gateway error.

The only way I was able to get it working properly was to set the servers ip in my /etc/hosts file to example.com. But thats not an option because I have to send the preview url to my client and it should work out of the box.


Solution

  • Unfortunately I don't have access to the Website Preview Settings mentioned in Oleg's answer.

    But I found a workaround using xip.io.

    Simply create a domain alias called

    example.com.xxx.xxx.xxx.xxx.xip.io
    

    within Plesk and you're able to access the website without setting up any DNS records. I don't know why, but without the domain alias it hasn't worked.