Shutdown Wordpress instance and redirect all traffic to other website
-
Dear all,
I have to shutdown a Wordpress instance and I don't want users see «You are seeing this page because the DNS record of mydomain.com is set to this server's IP but Cloudron has no app configured for this domain».
How I can shutdown instance and redirect all traffic to other website? Eg. mydifferentdomain.com.
Thank's a lot
-
How I did it (if I understand you correctly):
- Changed Domain of the Wordpress instance from wordpress.domain.com to wordpressold.domain.com
- Stopped the Wordpress instance
- Installed Surfer at wordpress.domain.com with an index.html (which can redirect)
-
@necrevistonnezr Thank's a lot, this is a good idea but you've to keep an instance (Surfer) always active, right?
-
-
@nebulon Thank's a lot Nebulon, I was evaluating this solution as first approach, but I should keep the instance, even off, and not delete, right?
Also, I tried to configure the redirect on domain hosted on the same Cloudron instance, but system does not allow me to configure redirect, from domain.com to newdomain.com (without any www or subdomain), as per this screenshot:
-
@p44 You can do this in a few ways, depending on your use case:
- With surfer, you can use create a 404.html . In javascript, use something like https://stackoverflow.com/questions/20077103/page-redirect-with-path-using-javascript . Here's an ultra basic 404.html:
<html> <script> window.location = "https://cloudron.io"; </script> <body> Not found </body> </html>
- Another idea is to use the LAMP app and configure apache to redirect using redirect rules.
When to use which? Off my head:
- Use surfer, if you want to show a page which has the classic "redirecting in 3..2..1".
- Use lamp, if you want to redirect asap. This also does redirect at http level. So, a brower can potentially cache/remember this information and will be faster for future access (but with the danger that it will not hit your site anymore).
-