我的网站 www.site.com
加载apache2'它的工作'页面,而不是预期的moude的主页,它位于 /var/www/html/moodle
. 有一个索引文件 index.php
但它并不是默认的。如果我到 www.site.com/moodle
网站主页来了。配置文件 /etc/apache2/sites-available/site.conf
是启用的。如何解决这个问题?
<VirtualHost *:80>
ServerName www.site.com
ServerAlias site.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/moodle
DirectoryIndex index.php
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.site.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI}
[END,NE,R=permanent]
</VirtualHost>
这可以通过修改以下一行来解决
DirectoryIndex index.php
到
DirectoryIndex index.php /moodle/index.php
档案中 /etc/apache2/sites-available/site.conf
.