directory - Move Wordpress from Root to Subfolder

The standard problem of moving the WP installation from the root into the my_subdir folder keeping the url www.example.R

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 change example and my_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 and home 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 the my_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 change example.com and my_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 and home 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 the my_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 Do you want to put WP in a sub directory but still be able to browse it without using that sub directory? If so, why? – janh Commented Nov 6, 2017 at 17:21
  • 1 Just to clarify, you want to move WP into a subdirectory, but you want just the homepage to be at the root domain? WP is either in a subdirectory or not. If WP is your full website, it would be better to either leave it in the root directory or move it completely. When you move it completely you can create a redirect so that people who go to www.example.com go straight to www.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:28
  • I am just follow whe Method I guide, keeping the URL www.example.com, moving WP from Root into my_subdir – Brethlosze Commented Nov 6, 2017 at 17:31
  • 1 I agree with WebElaine, it is not clear what you're trying to accomplish. Forget about the articles and concentrate your question on what you're trying to do (as opposed to explaining within the context of possibly unrelated articles). – Tony M Commented Nov 6, 2017 at 17:45
  • Ok, i am looking for moving the WP installation from the Root public_http into a my_subdir folder, and keeping the www.example.com original url. The motivation is to keep several WP installations, for different subdomains. – Brethlosze Commented Nov 6, 2017 at 17:47
Add a comment  | 

1 Answer 1

Reset to default 1

Here 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

相关推荐

  • directory - Move Wordpress from Root to Subfolder

    The standard problem of moving the WP installation from the root into the my_subdir folder keeping the url www.example.R

    4月前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信