【发布时间】:2014-04-11 22:11:15
【问题描述】:
我的网站由我的朋友完成,它已在公共服务器上启动并运行。我试图在我的内部服务器上运行相同的网站。但是apache说找不到文件。我发现问题出在 .htaccess 文件中。这是我的文件
AddType text/x-component .htc
#BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
在我的 apache conf 文件中我设置了
<VirtualHost *:80>
DocumentRoot /srv/www/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /srv/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Deny,Allow
Deny from all
Allow from 192.168.43.0/255.255.255.0 192.168.42.0/255.255.255.0
<Directory /srv/www/companies/test1/>
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Order Allow,Deny
Deny from all
Allow from 192.168.43.0/255.255.255.0 192.168.42.0/255.255.255.0
</Directory>
</Virtualhost>
错误日志显示
[Fri Apr 11 16:57:33 2014] [error] [client 192.168.43.8] File does not exist:/srv/www/cms
[Fri Apr 11 16:57:33 2014] [error] [client 192.168.43.19] File does not exist:/srv/www/products, referer: http://192.168.43.8/companies/
我猜 htaccess 在 /srv/www/ 文件夹而不是 /srv/www/companies/test1/ 文件夹中寻找 index.php。有什么建议如何将 htaccess 引导到正确的位置?
【问题讨论】: