PHP 在将您的博客留在根目录中的同时为WordPress提供自己的目录

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP 在将您的博客留在根目录中的同时为WordPress提供自己的目录相关的知识,希望对你有一定的参考价值。

The process to move WordPress into its own directory is as follows:

Create the new location for the core WordPress files to be stored (we will use /wordpress in our examples). (On linux, use mkdir wordpress from your www directory. You'll probably want to use "chown apache:apache" on the wordpress directory you created.)
Go to the General panel.
In the box for WordPress address (URL): change the address to the new location of your main WordPress core files. Example: http://example.com/wordpress
In the box for Site address (URL): change the address to the root directory's URL. Example: http://example.com
Click Save Changes. (Do not worry about the error message and do not try to see your blog at this point! You will probably get a message about file not found.)
Move your WordPress core files to the new location (WordPress address).
Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress directory into the root directory of your site (Blog address). The .htaccess file is invisible, so you may have to set your FTP client to show hidden files. If you are not using pretty permalinks, then you may not have a .htaccess file.
Open your root directory's index.php file in a text editor
Change the following and save the file. Change the line that says:
require('./wp-blog-header.php');
to the following, using your directory name for the WordPress core files:
require('./wordpress/wp-blog-header.php');
Login to the new location. It might now be http://example.com/wordpress/wp-admin/
If you have set up Permalinks, go to the Permalinks panel and update your Permalink structure. WordPress will automatically update your .htaccess file if it has the appropriate file permissions. If WordPress can't write to your .htaccess file, it will display the new rewrite rules to you, which you should manually copy into your .htaccess file (in the same directory as the main index.php file.)

以上是关于PHP 在将您的博客留在根目录中的同时为WordPress提供自己的目录的主要内容,如果未能解决你的问题,请参考以下文章

如何在不将您的应用设为默认消息应用的情况下将短信发送到 android 中的特定应用?

Azure Devops NPM 请将您的工作目录更改为有效目录

链接建设初学者指南(第2章 如何建立链接)

链接建设初学者指南(第2章 如何建立链接)

php 自定义wp-signup.php,以便用户在注册时可以留在当前的博客中

intelliJ -> 有啥方法可以将您的搜索范围限定在一个函数内