admin管理员组文章数量:1122846
My goal is to have a test.example.de testing environment for my www.example.de WP Blog.
Sadly, the site is still redirecting me to the production-site.
My subdomain is registered as a CNAME with a TTL of 3600 (INVX). I also added it to my domains on my server-hosting dashboard (UBERSPACE).
Here are all of the steps I made:
Copied html directory (whole production-site) to my local disk
Created a new directory called dev.example.de (note that my hosting provider uberspace is handling subdomains like that, so no need for setting up a vhost. I've also tested it with a simple index.html before I continued and it worked well).
Copied the whole site back to the server via SFTP into the new directory
Changed DOMAIN_CURRENT_SITE to my new subdomain URL (test.example.de) inside the wp-config.php file.
Added the following lines inside the wp-config.php file:
/* URL for Subdomain */
define('WP_HOME','http:/\/test.example.de');
define('WP_SITEURL','http:/\/test.example.de');
- Added allow repair:
a /* Allow repair */
define('WP\_ALLOW\_REPAIR', true);
- Copied the database of my production site in phpMyAdmin and changed the URL in wp_blogs and wp_site to the subdomain URL. The wp_blogs in the production site database looks like that:
domain: www.example.de path: /
The wp_blogs in the testing site database looks like that now:
domain: test.example.de
path: / (I also tried pointing to the directory (/user/test.example.de/), but it didn't work either)
- Changed DB_Name to the new database name inside the wp-config.php file.
Note: Before I made changes to the wp_blogs, I wasn't being redirected, but it said: Connection to database failed. The site has also not been updated in a few months. Same for plugins. I wanted to do all that in the testing environment first, to see if there will be issues and to avoid downtime of the blog.
My goal is to have a test.example.de testing environment for my www.example.de WP Blog.
Sadly, the site is still redirecting me to the production-site.
My subdomain is registered as a CNAME with a TTL of 3600 (INVX). I also added it to my domains on my server-hosting dashboard (UBERSPACE).
Here are all of the steps I made:
Copied html directory (whole production-site) to my local disk
Created a new directory called dev.example.de (note that my hosting provider uberspace is handling subdomains like that, so no need for setting up a vhost. I've also tested it with a simple index.html before I continued and it worked well).
Copied the whole site back to the server via SFTP into the new directory
Changed DOMAIN_CURRENT_SITE to my new subdomain URL (test.example.de) inside the wp-config.php file.
Added the following lines inside the wp-config.php file:
/* URL for Subdomain */
define('WP_HOME','http:/\/test.example.de');
define('WP_SITEURL','http:/\/test.example.de');
- Added allow repair:
a /* Allow repair */
define('WP\_ALLOW\_REPAIR', true);
- Copied the database of my production site in phpMyAdmin and changed the URL in wp_blogs and wp_site to the subdomain URL. The wp_blogs in the production site database looks like that:
domain: www.example.de path: /
The wp_blogs in the testing site database looks like that now:
domain: test.example.de
path: / (I also tried pointing to the directory (/user/test.example.de/), but it didn't work either)
- Changed DB_Name to the new database name inside the wp-config.php file.
Note: Before I made changes to the wp_blogs, I wasn't being redirected, but it said: Connection to database failed. The site has also not been updated in a few months. Same for plugins. I wanted to do all that in the testing environment first, to see if there will be issues and to avoid downtime of the blog.
Share Improve this question edited Apr 14, 2024 at 21:54 Erick Holz asked Apr 12, 2024 at 14:40 Erick HolzErick Holz 12 bronze badges1 Answer
Reset to default 0I made it work by doing both the "Standart Find & Replace" and "Custom Find & Replace" steps when exporting the database via the Wordpress-Plugin "WP Migrate". Before succeeding, I skipped the "Standart Find & Replace" step, because I thought the custom step would be enough.
Down below you can see both steps with www.example.com as the production site and dev.example.com as for the testing site as an example:
Enjoy!
本文标签: phpDuplicated WP Multisite for testing environment is redirecting to production site
版权声明:本文标题:php - Duplicated WP Multisite for testing environment is redirecting to production site 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736310430a1934374.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论