WordPress搬家

WordPress热度:238 ℃只有孤单的一条吐槽阅读模式

Giving WordPress its Own Directory While Leaving Your Blog in the Root Directory

Many people want WordPress to power their site’s root (e.g. http://example.com) but they don’t want all of the WordPress files cluttering up their root directory. WordPress allows you to install the WordPress files to a subdirectory, but have your blog exist in the site root.

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

1.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.)
2.Go to the General panel.
3.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
4.In the box for Blog address (URL): change the address to the root directory’s URL. Example: http://example.com
5.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.)


6.Move your WordPress core files to the new location (WordPress address).
7.Copy 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.
8.Open your root directory’s index.php file in a text editor
9.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’);
10.Login to the new location. It might now be http://example.com/wordpress/wp-admin/
11.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.)

WordPress博客搬家

/*不寂寞,才旅行*/

相关日志-小站地图为你展开

<<下一篇
上一篇 >>

只有孤单的一条吐槽 在《 WordPress搬家 》

快来吐槽吧

貼張圖 您还可以输入300个字

(鬼脸) (额) (难过) (闷骚) (钱哇) (鄙视) (蛋定) (睡觉) (看看) (生气) (猪头) (汗) (晕) (无语) (无法表达) (微笑) (得意) (开怀) (媚眼) (囧) (嘿嘿) (哼) (哭泣) (不说话)
才华是刀刃,辛苦是磨刀石 X
欢迎光临, 主人暂时不在,一切由我来接待哟~~
N
返回顶部▲ | 想去底部 ▼ | 想评论 X