這是我的代碼:Ubuntu的: 「DocumentRoot的不退出」
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot var\www\public
ServerName my_ip
</VirtualHost>
<Directory "/var/www/public">
Options FollowSymLinks
AllowOverride All
</Directory>
但有錯誤:
[Mon Feb 25 01:38:54 2013] [warn] NameVirtualHost *:80 has no VirtualHosts ... waiting Warning: DocumentRoot [/etc/apache2/var\www\public] does not exist apache2: Could not reliably determine the server's fully qualified domain name, using "my_ip" for ServerName
[Mon Feb 25 01:38:55 2013] [warn] NameVirtualHost *:80 has no VirtualHosts
爲什麼DocumentRoot的搜索在/etc/apache2/var\
,我寫var\www\public
那修復我的問題:/var/www/public
。
不是'RewriteRule ^。* $ - [QSA,L]'而不是'RewriteRule ^。* $ - [NC,L]'?你不需要'NC'作爲這個條件,'QSA'正在添加請求查詢字符串(不要以爲它修復了這個問題)。它現在總是按照這個規則離開(因爲'^。* $')。 – 244an 2013-02-24 22:31:00