我讓我的網站完成了我的朋友,它在公共服務器上運行。我試圖在我的內部服務器上運行同一個網站。但apache說沒有找到文件。我發現問題出在.htaccess文件中。這是我的文件.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 lokking爲的index.php/www/文件夾代替/srv/www/companies/test1/文件夾。任何建議如何將htaccess指向正確的位置?
感謝您的洞察力選擇「服務器」菜單。但是我不能改變我的DocumentRoot,因爲有其他服務正在運行。也許我可以使用這個網站的其他端口? – vignesh
我建議你在我的答案的第二部分中實現我提到的內容,並設置一個新的VirtualHost,將DocumentRoot設置爲正確的路徑。 您可以使用另一個端口,也可以使用相同的端口,但切換到使用Host:標題確定要提供哪個站點的「命名虛擬主機」。每個這些場景的示例都可以從我的「VirtualHost示例」鏈接獲得。 – ssnobody