admin管理员组文章数量:1323150
I've been trying to move my WP site to a sub-directory, let's say /blog instead of mysite, i've been able to do this successfully in the past but now everything is going wrong. I followed several guides and here's what i tried so far:
Moved all wp-* files, index.php and .htaccess to the "blog" folder in /www/html after changing the URL in the wordpress dashboard;
Edited .htaccess to include redirects from several guides/questions i have found;
Added the following to wp-config.php:
define('WP_HOME',''); define('WP_SITEURL','');
Deleted several plugins that i suspected were causing redirects or issues;
Edited index.php and added /blog to '/wp-blog-header.php';
Changed permissions of the "blog" folder where i placed the wordpress files;
Went into the sql database and altered the URL's in the wp-options table;
None of these things have worked and so far, i tried them separately and together, the furthest i got was getting the home page to load, wp-admin loads but only html and logging in does nothing. In all other instances i get 403 forbidden errors and 404 not found. If anyone knows what i'm missing, would appreciate it.
Note: I'm running on a vps so experimenting isn't an issue considering i have backups.
I've been trying to move my WP site to a sub-directory, let's say /blog instead of mysite, i've been able to do this successfully in the past but now everything is going wrong. I followed several guides and here's what i tried so far:
Moved all wp-* files, index.php and .htaccess to the "blog" folder in /www/html after changing the URL in the wordpress dashboard;
Edited .htaccess to include redirects from several guides/questions i have found;
Added the following to wp-config.php:
define('WP_HOME','https://www.example/landing'); define('WP_SITEURL','https://www.example/landing');
Deleted several plugins that i suspected were causing redirects or issues;
Edited index.php and added /blog to '/wp-blog-header.php';
Changed permissions of the "blog" folder where i placed the wordpress files;
Went into the sql database and altered the URL's in the wp-options table;
None of these things have worked and so far, i tried them separately and together, the furthest i got was getting the home page to load, wp-admin loads but only html and logging in does nothing. In all other instances i get 403 forbidden errors and 404 not found. If anyone knows what i'm missing, would appreciate it.
Note: I'm running on a vps so experimenting isn't an issue considering i have backups.
Share Improve this question asked Sep 1, 2020 at 23:06 Aspire EnvorAspire Envor 11 Answer
Reset to default 0If you move a site, there are many instances in the database that have the URL hard-coded (media file pointers are one). You need to replace the old URL with the new one. You can do that with a search/replace plugin, or manually.
BUt the easiest way to do that, IMHO, is to use the "Clone" plugin from Automaticc. You install the plugin on the old and new sites (no matter where they are). You make sure the new site works at it's new (temporary) URL (like www.example/foldername).
So, install a brand new instance of WP on the new folder. Make sure you can log in there. Install the Clone plugin on the new place. Don't need anything else installed, as everything will be replaced.
Then you log into the old site, install the Clone plugin, and run the backup program. Copy the backup to local computer. Make sure you know the admin user account of the old site, because everything is replaced on the new site - user accounts also.
Then (in a new browser window), change your hosting to point the domain to the new folder (say 'foldername'). Change the URLs in the wp-options table manually to the domain name (from www.example/foldername to www.example). Make sure you can log into the new domain (with the new sites' credentials).
Install the Clone plugin on the new place (if not already there). Restore the site the zip file you saved locally. You'll then need to log in with credentials from the old place. And now www.example will be pointing to your subfolder.
Note: I'm not a big fan of making the URL change in the config file as you did. I like to have the correct URL in the wp-options table (in two places). Note that any URL settings in the config file override the wp-options settings - I just like it in wp-options so I don't confuse myself later on.
本文标签: 404 errorCould use some help moving site to subdirectorywhat am i doing wrong
版权声明:本文标题:404 error - Could use some help moving site to subdirectory, what am i doing wrong? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742143425a2422683.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论