【发布时间】:2012-11-12 18:37:21
【问题描述】:
我试图让我的服务器在本地看起来很整洁(我发誓我是强迫症),我正在做的是将 wordpress 博客与我的所有子域结合起来。
我的 wordpress 博客是我的主要网站 example.com。而我的子域位于 sub.example.com。
现在,我有这个设置:
public_html
( wordpress files here )
subdomains
sub1 - (sub1.example.com)
sub2 - (sub2.example.com)
sub3 - (sub3.example.com)
blog - (empty)
blog 文件夹为空。但是,我想将所有 wordpress 文件移动到 blog/,但将博客的 URL 保留在 http://www.example.com/。因此,http://www.example.com/index.php 将转到 http://www.example.com/blog/index.php,以及 blog/ 中的所有目录。
此代码无效:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ blog/$1.php [L]
它反而给了我 / 的索引。有没有办法做到这一点?
【问题讨论】:
标签: wordpress .htaccess directory blogs move