The standard problem of moving the WP installation from the root into the my_subdir
folder keeping the url www.example
.
Regarding the article Moving a Root install to its own directory, Method I (Without URL change)
- After Installing the wordpress in root folder, move EVERYTHING from root folder into subdirectory
- Create a
.htaccess
file in root folder, and put this content inside (just changeexample
andmy_subdir
)
These instructions simply do not work. They are even inconsistent with the article Moving Wordpress!
Do somebody have the correct instructions?
- Should i change the
siteurl
andhome
DB options? - Should i change the original
.htaccess
created by WP when updating the Permalinks? - Should i change the
index.php
last line to include themy_subdir
? - Can the hosting be messing something disabling the functionality of the
.htaccess
around?
Update: Both Method I and Method II keep failing at the last step of logging in back. I am following the exact steps, and no, something in the new version of WP is messing with the subfolder installation (what?).
The standard problem of moving the WP installation from the root into the my_subdir
folder keeping the url www.example.com
.
Regarding the article Moving a Root install to its own directory, Method I (Without URL change)
- After Installing the wordpress in root folder, move EVERYTHING from root folder into subdirectory
- Create a
.htaccess
file in root folder, and put this content inside (just changeexample.com
andmy_subdir
)
These instructions simply do not work. They are even inconsistent with the article Moving Wordpress!
Do somebody have the correct instructions?
- Should i change the
siteurl
andhome
DB options? - Should i change the original
.htaccess
created by WP when updating the Permalinks? - Should i change the
index.php
last line to include themy_subdir
? - Can the hosting be messing something disabling the functionality of the
.htaccess
around?
Update: Both Method I and Method II keep failing at the last step of logging in back. I am following the exact steps, and no, something in the new version of WP is messing with the subfolder installation (what?).
Share Improve this question edited Nov 6, 2017 at 21:05 Brethlosze asked Nov 6, 2017 at 17:17 BrethloszeBrethlosze 1491 gold badge2 silver badges11 bronze badges 5 |1 Answer
Reset to default 1Here is the instructions if we suppose that you intially installed your site into ROOT folder (in the link you provided it's the method called Method II (With URL change) ).
There are two important steps and between them your site may break but it's not an issue :
I) First you need to update the link in the settings of your site. But you only need to update the WordPress Address (URL) by adding the subdirectory at the end to make it like this www.yoursite.com/subdir
.
Now your site can stop working but no worries.
II) Second move all your files to the subdir then copy .htaccess file and index.php file from subdir and put them into the root directory (copy them and don't move them back you need to have a copy in root and a copy in subdir).
Open index.php file you moved to root and make these changes :
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
become
require( dirname( __FILE__ ) . '/subdir/wp-blog-header.php' );
After this we are done, now you simply need to login to your site and save permalink structure again (without doing any changes) to be sure the url rewriting is updated correctly.
NOTE that your new admin access will be : www.yoursite.com/subdir/wp-admin.
I also advice you to clear your cookies and cache after migration to avoid any issues.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1737332883a3938526.html
www.example.com
go straight towww.example.com/my_subdir
to view the site. Perhaps you could provide more information about why you are looking for this solution so we can understand better and offer more help. – WebElaine Commented Nov 6, 2017 at 17:28www.example.com
, moving WP from Root intomy_subdir
– Brethlosze Commented Nov 6, 2017 at 17:31public_http
into amy_subdir
folder, and keeping thewww.example.com
original url. The motivation is to keep several WP installations, for different subdomains. – Brethlosze Commented Nov 6, 2017 at 17:47