导致在加载Moodle网站时打开默认的Apache页面的原因

问题描述 投票:0回答:1

我的网站www.site.com加载apache2'It works'页面,而不是位于/var/www/html/moodle的穆迪预期主页。在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>
apache web-services server ubuntu-18.04 moodle
1个回答
0
投票

这可以通过更改行来解决

DirectoryIndex index.php

to

DirectoryIndex index.php /moodle/index.php

在文件/etc/apache2/sites-available/site.conf中。

来源:https://httpd.apache.org/docs/2.4/mod/mod_dir.html

© www.soinside.com 2019 - 2024. All rights reserved.