更改安装 WordPress 的目录的文件夹名称
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8425042/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Change the folder name for the directory WordPress is installed in
提问by marky
I just installed WordPress in a subfolder on my site (http://www.example.com/wordpress/) and I want to change the folder name from "wordpress" to "blog". I've already gone through the entire installation process, but have not made any customizations at all yet.
我刚刚在我的网站 (http://www.example.com/wordpress/) 的一个子文件夹中安装了 WordPress,我想将文件夹名称从“wordpress”更改为“blog”。我已经完成了整个安装过程,但还没有进行任何自定义。
I tried just renaming the folder on the server, and the blog page does load, but some of the content was missing (the main, default header image, most notably), so I'm assuming there are other files that need to know the directory name as well.
我尝试只是重命名服务器上的文件夹,并且博客页面确实加载了,但是缺少一些内容(主要的默认标题图像,最显着),所以我假设还有其他文件需要知道目录名也是如此。
If this is even feasible/possible without a complete reinstall, how do I change the folder name of a new WordPress installation?
如果这在没有完全重新安装的情况下甚至可行/可能,我该如何更改新 WordPress 安装的文件夹名称?
回答by Groovetrain
I'm pretty sure you have to also change it in the database before you go changing the folder name. Try going to settings->general
in your wp-admin area and it'll be one of the first few input fields there.
我很确定在更改文件夹名称之前,您还必须在数据库中更改它。尝试进入settings->general
您的 wp-admin 区域,它将成为那里的前几个输入字段之一。
So, change those two fields, save (the page might not come back however), then change the folder name.
因此,更改这两个字段,保存(但是页面可能不会返回),然后更改文件夹名称。
回答by HIRA THAKUR
Step 1 :
第1步 :
Go to settings->general and update your Site Address (URL) and WordPress Address (URL) to http://example.com/new_folder_name
转到设置-> 常规并将您的站点地址 (URL) 和 WordPress 地址 (URL) 更新为http://example.com/new_folder_name
step 2 :
第2步 :
Rename the folder name from wordpressto blog
将文件夹名称从wordpress重命名为blog
step 3 :
第 3 步:
Add this to wp-config.php file :
将此添加到 wp-config.php 文件:
define('WP_HOME','http://example.com/new_folder_name'); define('WP_SITEURL','http://example.com/new_folder_name);
定义('WP_HOME',' http://example.com/new_folder_name');定义('WP_SITEURL',' http://example.com/new_folder_name);
Please clear your browser cache and relogin.
请清除浏览器缓存并重新登录。
回答by Rowe Morehouse
You don't have to touch the database settings. And all the instructions at codex (http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory) are overly complex. Believe it or not, ehow.com has the best step-by-step answer for this task:
您不必触摸数据库设置。Codex (http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory) 上的所有说明都过于复杂。信不信由你,ehow.com 为这项任务提供了最好的分步答案:
http://www.ehow.com/how_6558163_changing-wordpress-directory-name.html
http://www.ehow.com/how_6558163_changed-wordpress-directory-name.html