• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Previewing Wordpress website using temporary URL

Denis Gomes Franco

Regular Pleskian
I know this is *not* an issue with Toolkit itself, and I'll also post a workaround on my own question so that others with the same issue can see the solution, but I think I'll post this here like a feedback of sorts. So here's the situation I sometimes face when working on website redesign projects:

- Customer has their domain pointed to his old DNS and hosting server
- They want to see the new site being developed, without the old one taken down/without pointing the domain right now
- I add the customer's domain to Plesk, just to create the hosting space and put the new files in there
- Plesk has a 'preview' feature, which I have configured under my own domain, so I can view the new website using 'customerdomain.com-server.ip.here-mydomain.com'
- This works like a charm for static websites but not for Wordpress, because Plesk installs Wordpress and sets the site URL to be that of the domain's
- So when I open customerdomain.com-server.ip.here-mydomain.com Wordpress redirects to the URL, which is still pointing to the old server

My workaround for this is to open the database and change 'siteurl' and 'home' under 'wp_options' to 'http://customerdomain.com-server.ip.here-mydomain.com', then refresh the site on Toolkit. Now the site opens just fine, except for the SSL warnings.

So here is my feedback on how this issue could be addressed:
- Allow Toolkit to install Wordpress to the preview URL instead of the domain URL
- Make the Update Site URL function in Toolkit work with the preview URL as well
- Create a Update URL function (i normally use the Better Search & Replace plugin for this purpose when I need to migrate something) which allows manually typing the domain

I'm aware I could simply point the domain over here anyway and then add the entries pointing to the old server, so that way I can create a 'staging' subdomain, but I just find this way of doing things is just faster and easier in the beginning. When the new site is ready, I simply do a search & replace in the database to update to the new URL and then point the domain, and that's it.
 
Hello Denis Gomes Franco

I hope you're well.

First, thank you for the detailed post. I'm having the same problem

I understand I need to change 'siteurl' and 'home' within the 'wp_options' database table.

However, I don't understand the URL 'http://customerdomain.com-server.ip.here-mydomain.com/'
I understand parts 1 and 2 of the URL i.e. 'https//customerdomain.com-123.123.123.123.'
But not the third part i.e. 'here-mydomain.com/'

Can you give me another example, please? Or can anyone else on the forum, thanks!

Kind Regards.
 
Just to better answer you question; what is it exactly you don't understand?

Plesk has a feature that allow users to preview their websites via a preview URL. Which you can enable via Tools & Settings > Website Preview. When enabled you'll find a Preview link in Plesk for each domain. You can use that link in the 'siteurl' and 'home' database fields within the 'wp_options' database table.
Schermafbeelding 2022-12-14 163708.png
 
Last edited:
Hi @Kaspar

Thank you for the quick response.

OK when I click the Preview button it takes me out to the live website e.g. https://customersite.com
I am redeveloping the said same website on my Plesk server but I can't access the WordPress Admin backend because I keep getting pushed to the live site.

I've tried changing 'siteurl' and 'home' to different permutations but I get 500 or 404 responses from the server.

If I add a new temporary domain then obviously it works:
1671033574302.png

1671033642343.png

But that means migrating the site when I'm done, which isn't a lot of work but feels unnecessary.

Also, the customer is greeted by a nasty chrome warning:

1671033921059.png

And if I try to log in via URL the website doesn't know my credentials ???

1671033893238.png

I hope I've explained myself well.

Kind Regards.
 
The web space credentials are not the same like the Wordpress credentials. You can set new Wordpress credentials on your Wordpress Toolkit page.

The "deceptive page" warning can be ignored in case of your own *.plesk.page subdomain. It may be triggered, because cyber criminals are abusing free subdomain pages for their nasty stuff so that their main domain gets listed with some blacklists. But it is safe to use with your own domain anyway.
 
@Peter Debik

Thank you for the update.

I will carry on using the temporary domain and then migrate it when I'm finished.

But thanks for the information, I suspected that someone must have been abusing the free domains in the past, as it was just freshly created.

Kind Regards.
 
Back
Top