设置根域名指向子目录失败,求解(on debian)

2015-11-30 00:33:20 +08:00
 GNiux
在一个 debian VPS 上建站, LAMP.

APT 直接下了 WordPress. Debian 说 WordPress 在 debian 上有些区别。也按照 debian 方式部署了,如:

https://wiki.debian.org/WordPress

折腾差不多了,就差把根域名指向我的 WP 所在目录了 (debian 默认把它放在 /usr/share/WordPress, 及另一个地方,而非 www/之类)

然后我就按照 WordPress.org 的攻略操作:

http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

其中的:

Using a pre-existing subdirectory install

If you already have WordPress installed in its own folder (e.g., http://example.com/wordpress), then the steps are as follows:
1. Go to the General panel.
2. In the box for Site address (URL): change the address to the root directory's URL. Example: http://example.com
3. 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.)
4. Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress (wordpress in our example) directory into the root directory of your site — the latter is probably named something like www or public_html. 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. If you are running WordPress on a Windows (IIS) server and are using pretty permalinks, you'll have a web.config rather than a .htaccess file in your WordPress directory.
5. Edit your root directory's index.php. 1. Open your root directory's index.php file in a text editor
2. Change the line that says:
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
to the following, using your directory name for the WordPress core files:
require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );
3. Save the file.

6. Login to your site (if you aren't still already). The URL should still be http://example.com/wordpress/wp-admin/
7. 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.)

Since the site is not working for some of these steps, it is best to make this change at a time of low activity, e.g., the middle of the night.


可是,就是……没效呢? 访问根域名是一片空白……

(不知信息量足够没?……手机打字累了…
1988 次点击
所在节点    WordPress
2 条回复
maskerTUI
2015-11-30 08:58:12 +08:00
装个 lnmp 或者 amp 再加个 WordPress 不是一样的效果吗?比这文档简单多了
GNiux
2015-11-30 10:33:08 +08:00
@maskerTUI

是装了 lamp+ WordPress 呀

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/239902

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX