返回列表 回复 发帖

能否指定一个不再根目录的文件作为默认的首页啊?

我的blog安装在了blog目录下面,所以我希望能指定blog下面的index.php作为默认的主页。

我知道一个间接的办法是在根目录的index.html中加上一个跳转预计,打开这个页面之后,再跳转到blog下面的index.php,但是这样实在不爽。
=====Keep It Simple, Stupid=====
行为源自需求,理念成就未来!
沮丧大多只是愤怒;愤怒大多只是恐惧。
BLOG
直接绑定到blog不就行了?我看懂了么?
不明白到底什么意思
欢迎交流:
老杨个人空间
怎么绑定到blog目录啊?
=====Keep It Simple, Stupid=====
行为源自需求,理念成就未来!
沮丧大多只是愤怒;愤怒大多只是恐惧。
BLOG
将默认首页文件名必须要设置成blog里的那个,不知道可以不? 也就是说你在前面添加一个路径
掌上浮云:
www.akay.cn
大体明白你的意思了,如果不是新添加域名的话,按现有域名的话,

注意操作步骤要严格按照这来,每步的顺序不要弄错,否则你可能就进不了后台,或者页面无法打开。而一旦出现那些问题就只能手动修改数据库了。

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).
   2. Go to the Options 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 Update Options. (Do not worry about the error message and do not try to see your blog at this point!)
   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).
   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.)

原文地址:http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

翻译下就是

把WordPress放到单独它单独目录下的程序如下:

1、新建一个用来存放WordPress核心文件的新文件夹(本例以/wordpress示范)。(也就是你的/blog)

2、进入选项(options)面板。

3、找到WordPress address (URL)(中文用户请查找”WordPress 地址(URL)“)这个选项:把后面的地址改成你存放WordPress文件的文件夹地址。比如:http://example.com/wordpress (/blog)

4、找到Blog address (URL)(中文用户请查找”Blog 地址(URL)“)这个选项:把此地址改为你网站的根目录的URL。例如:http://example.com

5、点击Update Options(中文用户为”更新设置“)。

6、把WordPress的核心文件转移到你新建的文件夹中,也就是WordPress address (URL)这个目录。还不明白?在明确一点:/wordpress目录。

7、把index.php和.htaccess文件从WordPress目录转移到根目录(即Blog address)中。

8、用文本编辑器打开并编辑根目录下”index.php”这个文件。

9、找到如下代码,修改并保存:找到

    require(’./wp-blog-header.php’);

把地址改为你WordPress目录下的文件:

    require(’./wordpress/wp-blog-header.php’);

10、登陆控制面板,新的控制面板地址为http://example.com/wordpress/wp-admin/

11、如果你设置了结构化链接地址(Permalinks),打开永久链接选项面板更新Permalinks结构。如果.htaccess有正确的权限设置的话WordPress会自动更新你的.htaccess文件。如果 WordPress不能写入你的.htaccess文件,就会显示新的rewrite规则,因此你就需要手动把rewrite规则复制到. htaccess文件中(和index.php同目录)。

翻译在这找的:http://www.wopus.org/giving-wordpress-its-owndirectory.html

[ 本帖最后由 feng 于 2008-9-28 19:50 编辑 ]
资料找的不错。
非常感谢大家的解答,尤其是6楼的朋友。
=====Keep It Simple, Stupid=====
行为源自需求,理念成就未来!
沮丧大多只是愤怒;愤怒大多只是恐惧。
BLOG
我也学到了一招、
掌上浮云:
www.akay.cn
这个方法确实巧妙
欢迎交流:
老杨个人空间
返回列表