Webinoly is just the perfect tool for NGINX experts. Give it a try!
0 votes
2.1k views
by Rookie
retagged by

I really love this clone function. For me its really awesome. Whenver I have idea to sell something, I just create a subdomain or buy a new domain, and use clone to get the page up in seconds, only using my phone! (termius ios apps)

But there is problem that I encounter sometimes, the new website redirect to the clone.

Example I have:
Mysitetemplate.com as the main.

site newwebsite.com -clone-from=Mysitetemplate.com

The website will auto redirect to Mysitetemplate.com

The only way that I know to fix this is to reinstall webinoly to a new server.

Please help me how to fix this.

1 Answer

0 votes
by Expert

Just a suggestion:

  • You say this only happens "sometimes", so when it happens, please try with a different browser or maybe from a different device.
  • See what's wrong with the Nginx configuration, that way if something is wrong we can reproduce it and fix it.
  • Redirections can be caused by a lot of different causes, if you don't provide details, we can hardly help you.
by Rookie
Im sorry, Im really a newbie. Please teach me how to provide details or point me to a link where I can read.
by Talented
Something similar happened to me recently, when I cloned a live site with  ssl and "redirect to www" activated. The clone got into a redirection loop (If I remember correctly, all browsers were saying that there had been to many redirects) and by digging into it I saw that the site's conf file under sites-available/ was messed up. Some parts of the code seemed to be duplicating themselves somehow and I had to manually clean it up.

Unfortunately, I was in a hurry and I didn't keep screenshots, but if it happens again I will make sure to do so and I will let you know.

If it helps, it happened when I tried to clone a live site to a staging one. When I try the opposite (staging to live) it runs smoothly.
by Expert

Yesterday I was working a lot with this feature because I will add support for external-databases in the next release, and I cannot reproduce this issue.

I found and fixed an issue when some DB passwords of the new site were messed up causing connection errors in some rare cases, but that's all.

If some of you know how to reproduce the issue you are describing here, would be very helpful.

by Talented
edited by

OK, I did a test cloning of the same site that I had cloned when I faced the issue. Here is a screenshot of the cloned site's conf file:

nginx -t says nginx: [warn] conflicting server name "test.com" on 0.0.0.0:80, ignored:

The source site's conf file starts like this:

I hope that it helps.

by Expert
Ok, for what I see in the screenshots, seems like we have an issue when trying to clone a site that has the "force-redirect" option enabled, Server name directive in the cloned site is incorrect. Am I right?

I will try to reproduce it!
by Talented
That was my guess too, that force-redirect messed with it somehow.

I hope that you figure this out :)

Thanks!
by Rookie
Im so sorry again because the conversation is beyond my comprehension. Please let me know if giving you my server login will help.
by Expert
This issue has been fixed in v1.11.0, released today.
by Talented

I tried cloning a live site today and I saw that the problem persisted, only this time it was affecting the original site as well. More specifically, when I did a db search and replace (with wp-cli) on the new site, the original site's urls seemed to be affected as well, but only on the frontend. Eventually, I found out that on the cloned site's wp-config.php the Redis directive was wrong, pointing to the original site's cache

define('WP_CACHE_KEY_SALT', 'redis_object_cache_for_wp_originalsite.gr');

instead of 
define('WP_CACHE_KEY_SALT', 'redis_object_cache_for_wp_clonedsite.gr');
Changing that, fixed the problem.
by Expert

That's a good one!

Webinoly is not updating the redis variable in wp-config.php, I will fix it in v1.11.1.

I don't know how wp-cli works and why this variable interferes with their search-replace function, but remember that Webinoly has a similar function to do the same -replace-content.

Thanks a lot for reporting this issue.

by Talented
edited by
WP-CLI has nothing to do with this, I just mentioned it as a sidenote. WP-CLI's search and replace doesn't interfere with the wp-config.php settings, it will just do a proper database search and replace (see https://developer.wordpress.org/cli/commands/search-replace/). It's probably the "official WordPress way" to do it.

From what I understood, the fact that wp-config.php pointed to the cache of the wrong site, resulted in updating the same cache for both the original and the clone. When I did a change on one of the two (in that case a simple search and replace), the cache was updated on a single place affecting both of them. So, each time one of the two sites ended up appearing broken, depending on which one I had modified last.
by Expert
Ok, now it makes sense!

Thank you, it'll be fixed in the next release.
by Talented

I don't know if it's related to the aforementioned bug, but I've noticed something else when I tried to clone a live site of www.example.gr to a staging one of the form staging.example.gr:

Under server_name it adds www.staging.example.gr, which is not needed.

by Expert
Sorry, this was just a bug introduced in the last release when I tried to fix the "force-redirect" issue. It's now fixed in v1.11.1, same for auth issue you reported.

You've been really helpful these days, Giorgos!

Thank you!
by Talented
Hi,

I'm bringing this up again, because I had the following issue:

I had a staging site and a live site. At some point, I wanted to update the staging with all the changes in the live one (mostly content-related). So, I deleted the staging and cloned the live (btw, some sort of "clone update" might be an interesting feature). Also, I chose to keep the certificate of the staging, since I intended to use the same domain again.

Everything seemed to work fine, except the site links were still pointing to the live site instead of the staging, so I had to manually do a search and replace of the url.

Also, I had to turn ssl off and on again.
by Expert

I'm not sure if I'm understanding your issue.

  • Which links were not updated? Only URLs in the content are updated.
  • SSL in a cloned site is disabled by default, until you turned on.
Can you please provide more details about how to reproduce this issue.
by Talented
It seems like it didn't perform a database search and replace at all. On the cloned staging.example.com, all links were pointing to www.example.com (which was the live site from which the clone came). Manually doing a search&replace fixed it.
by Expert
Not sure, but now that I see the "www", I think it may be related to the "force-redirect" option. I will check this issue in v1.12.1.
by Rookie
hi there, I have the same issue happening just like before, which is new website will randomly redirect to my other website, and some link like registration, login, wp-login.php are mixed up too. I will wait for v1.12.1.

If you want to have access to my server, please let me know.
by Expert
This issue has been fixed in Webinoly v1.12.1 released today.
Welcome to the Community site for Webinoly.

Our Optimized LEMP Web Server is a powerful set of commands for doing just about anything you could wish.

With Webinoly you can set up your NGINX web server in just one step.

* * * * * * *

To report a bug, please create a new issue on GitHub or ask a question here with the bug tag.
Webinoly Support Paypal Donations

PayPal · GitHub Sponsors · Bitcoin

It is very important that any visitor to the site read the disclaimer, terms of use and privacy and legal statement before start browsing.

...