• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue How to use preview for Wordpress when Domain is still live on another Server

rene1

New Pleskian
Hello,

how to use preview for Wordpress (WP) when original Domain is still live on another Plesk Server.
I have installed ngix and the preview button in Plesk on the new Server is visible.
So I add a domain www.xyz.de which is still productive on another Plesk webserver.

My goal is to quick install Wordpress with Plesk one-click installation on the new Server and test the hole WP Website BEFORE I switch the DNS settings to the new server.
So during testing, the customer shall see the old productive official website, while I can test the HOLE new site with the Plesk preview.

So the preview is working on the new server but ONLY for the WP homepage.
When I try to login to WP or click on any other Link, than the preview function is not working anymore.
The link direct me to the original domain, but there is no e.g. www.xyz.de/wp-login.php page because the original website is not made with WP.
From the preview I expected that I can test the hole page, not only the homepage.
So all the links in the preview mode shall be redirected / rewritten to the preview subdomain like e.g.
www.xyz.de/wp-login.php.MyPreview.Hostname.com

Does anybody know how I can see and test the hole website in Plesk BEFORE switching the DNS Settings?

What is the best way to switch a productive website to a new technique an check the new website before on a new server in the right domain and file directories with Plesk?

Best regards,

Rene
 
The preview function is fine. This is purely a Wordpress issue. The reason for the behavior is that in Wordpress (in the *_options table), the "siteurl" variable dictates, what prefix Wordpress adds to hyperlinks. You can open the homepage, because this responds to the test URL, but all links on the page have been created by the Wordpress algorithsm that inset the siteurl variable. That variable is pointing to the "real" domain, hence all subsequent clicks forward to the real site.

The only solution to avoid this is to update the homepage and siteurl variables in _options table of the Wordpress database. However, this should not be done manually, because you also need to update all links inside articles etc. A good approach is the "Duplicator" plugin by that you can pack a whole Wordpress site and install it on a different URL. The plugin updates all URLs to the test site, so that you can click through the whole site remaining on your test URL. Once you are ready for production, use the plugin again to adapt the URLs to the real location.
 
Hi Peter,

thanks for your response.
Now I understand a little bit more.

I will try this.

Best regards,

Rene
 
Thanks Peter
I've moved a website from our developement server to a plesk production server but we are in pre production. The formal URL is not yet live

What should be set home and site_url? the temp address?
 
Or you could just, on your local machine, edit the hosts file (/etc/hosts or %windir%\System32\drivers\etc\hosts) and enter the IP of the development server for the domain ...
There is nothing wrong with several servers thinking they are domain.com, but only those that are actually registered in DNS can be accessed normally.
 
Back
Top