我正在尝试设置Wordpress项目,以便http://www.example.com/
作为我的网站URL,例如映射到/var/www/vhosts/www.example.com/
在这里,我想使用以下结构:
/var/www/vhosts/www.example.com/wp-core/
/var/www/vhosts/www.example.com/wp-content/
/var/www/vhosts/www.example.com/wp-config.php
我想
wp-core/
将Wordpress core安装包含为
svn:external
和
wp-content
和
wp-config.php
存储在我的SVN repo中,包含每个站点的主题、配置等。
下面的文章将解释如何设置上述结构:http://codex.wordpress.org/Installing_WordPress_With_Clean_Subversion_Repositories
然而,我遇到了一个问题,即站点加载正确,从wp-config.php
上面的文件wp-core
然而,正如预期的那样,当我尝试登录时,Wordpress会从http://www.example.com/wp-login.php
到http://www.example.com/wp-login.php/
- 注意尾部斜杠。
这是对中额外行的确认wp-config.php
我为此添加了:
define(\'WP_CONTENT_DIR\', dirname(__FILE__) . \'/wp-content\');
define(\'WP_CONTENT_URL\', \'http://\' . $_SERVER[\'HTTP_HOST\'] . \'/wp-content\' );
以下是中的相关行
wp_options
在my DB中:
SELECT option_name,option_value FROM wp_options WHERE option_name = \'home\';
home,http://www.example.com
SELECT option_name,option_value FROM wp_options WHERE option_name = \'site url\';
siteurl,http://www.example.com
这是我的。htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
# Hey-ho let\'s go!
RewriteEngine On
# Base is the URL path of the home directory
RewriteBase /
# Base goes to WordPress
RewriteRule ^$ /wp-core/index.php [L]
# Skip real files and directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise send it to WordPress
RewriteRule .* /wp-core/index.php [L]
</IfModule>
# END WordPress
用Chrome追踪,我可以看到
HTTP 301
从正确的地址到带有尾部斜杠的地址由服务器返回,因此它将指向
.htaccess
然而,以下摘录的第一行与此有些矛盾:
127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (2) init rewrite engine with requested uri /wp-login.php/
127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (1) pass through /wp-login.php/
127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (3) [perdir /Users/joe/tmp/example.com/trunk-new/] add path info postfix: /Users/joe/tmp/example.com/trunk-new/wp-login.php -> /Users/joe/tmp/example.com/trunk-new/wp-login.php/
127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (3) [perdir /Users/joe/tmp/example.com/trunk-new/] strip per-dir prefix: /Users/joe/tmp/example.com/trunk-new/wp-login.php/ -> wp-login.php/
127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (3) [perdir /Users/joe/tmp/example.com/trunk-new/] applying pattern \'^$\' to uri \'wp-login.php/\'
127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (3) [perdir /Users/joe/tmp/example.com/trunk-new/] add path info postfix: /Users/joe/tmp/example.com/trunk-new/wp-login.php -> /Users/joe/tmp/example.com/trunk-new/wp-login.php/
127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (3) [perdir /Users/joe/tmp/example.com/trunk-new/] strip per-dir prefix: /Users/joe/tmp/example.com/trunk-new/wp-login.php/ -> wp-login.php/
127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (3) [perdir /Users/joe/tmp/example.com/trunk-new/] applying pattern \'.*\' to uri \'wp-login.php/\'
127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (2) [perdir /Users/joe/tmp/example.com/trunk-new/] rewrite \'wp-login.php/\' -> \'/wp-core/index.php\'
具体而言:
requested uri /wp-login.php/
指示Apache收到以下请求:
/wp-login.php/
而不是
wp-login.php
和
mod_rewrite
通过请求。
有没有人能给我提供一些建议,让我可以将WP核心文件放在文档根目录中的一个目录中wp-config/
WP核心目录旁边?