大约2个月前,我使用Ubuntu 14.04和Apache在DigitalOcean服务器上设置了一个应用程序 . 最初这很好用,但是现在大约2个星期,当我尝试在通常的域中访问应用程序时,我被发送到index page,而没有更改服务器中的任何内容 . 这个索引页让我相信DocumentRoot现在指向/ var / www而不是/ var / www / html,其中我的所有文件都是 . 我在网上搜索了答案,但我的所有配置文件都说DocumentRoot是/ var / www / html .

的Apache2 /网站可用/ SENDY:

DocumentRoot /var/www/html

    <Directory /var/www/html/>
        DirectorySlash Off
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

/etc/apache2/sites-available/000-default.conf.dpkg-dist:

ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

/var/www/html/.htaccess:

Options +FollowSymLinks
Options -Multiviews

RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([a-zA-Z0-9-]+)$ $1.php [L]

# Link tracker
RewriteRule ^l/([a-zA-Z0-9/]+)$ l.php?i=$1 [L]

# Open tracker
RewriteRule ^t/([a-zA-Z0-9/]+)$ t.php?i=$1 [L]

# Web version
RewriteRule ^w/([a-zA-Z0-9/]+)$ w.php?i=$1 [L]

# unsubscribe
RewriteRule ^unsubscribe/(.*)$ unsubscribe.php?i=$1 [L]

# subscribe
RewriteRule ^subscribe/(.*)$ subscribe.php?i=$1 [L]

有谁知道可能导致这种情况的原因是什么?