[英]Apache shows it works page even if i change the path of document root
我的問題是,當我放置wordpress.local.fr來顯示我的 wordpress 的歡迎頁面時,它總是向我顯示它的工作頁面。
但是當我制作wordpress.local.fr/wordpress 時它可以工作
這就是我所做的:
ubuntu服務器IP地址:192.168.52.130
<VirtualHost *:80>
ServerAdmin wordpress.local.fr
DocumentRoot /var/www/wordpress
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
192.168.52.130 wordpress.local.fr
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.52.130 wordpress.local.fr
wordpress 文件夾包含我所有的文件,沒有子文件夾,我使用samba在 Windows 和 ubuntu 服務器之間共享 /var/www/
[Share]
comment = Shared
path = /var/www/
browseable = yes
read only = no
guest ok = yes
writeable = yes
我不知道我哪里出錯了。 我可以檢查和更改什么?
我試圖在 fileindex 文件夾中只制作一個 txt 文件而不是我的 wordpress 項目,並在 DocumentRoot /var/www/fileindex 中制作總是我有它的工作頁面所以不考慮 DocumentRoot
# BEGIN WordPress
# END WordPress
我已經編輯了我的 htaccess 文件(在我的 wordpress/ 文件夾中)。 對此:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
我已將 serverAdmin 更改為 serverName ,如下所示:
<VirtualHost *:80>
ServerName wordpress.local.fr
DocumentRoot /var/www/wordpress/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
重新啟動我的 apache 后,它仍然是同樣的問題
提前致謝
在你的配置中我看到
ServerAdmin wordpress.local.fr
ServerAdmin 指令用於在 Apache 遇到錯誤時接收電子郵件,它應該是
ServerName wordpress.local.fr
您似乎需要更新.htaccess
文件(在您的wordpress/
文件夾中)。
將RewriteBase
從/
更改為/wordpress/
。
玩得開心!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.