简体   繁体   中英

Multiviews on VPS gives me Negotiation error

I'm just started using a VPS and i'm pretty new to Apache and everything.

So i have a few sites up and running, but for some reason i can't get Multiviews to work. I've searched on the internet and found an article that describes my problem, but their solution doesn't work. Also this thread on stackoverflow don't seem to work for me.

I started with the following (site.conf) configuration file in /etc/apache2/sites-availlable

<VirtualHost *:80>
    ServerName site.com
    DocumentRoot /var/www/vhosts/site.com/webroot/
    <Directory /var/www/vhosts/site.com/webroot/>
            Options Indexes FollowSymLinks Multiviews
            AllowOverride all
    </Directory>
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/site_acces.log combined
    ErrorLog ${APACHE_LOG_DIR}/site_error.log
</VirtualHost>

Now when i go to www.site.com/index.php it works fine, but www.site.com/index gives me a 404 and the following log message:

[Tue Feb 24 10:18:45 2015] [error] [client 213.125.184.74] Negotiation: discovered file(s) matching request: /var/www/vhosts/site.com/webroot/index (None could be negotiated).

So i changed site.conf to the following:

<VirtualHost *:80>
    ServerName site.com
    DocumentRoot /var/www/vhosts/site.com/webroot/
    <Directory /var/www/vhosts/site.com/webroot/>
            Options Indexes +FollowSymLinks -Multiviews
            AllowOverride all
    </Directory>
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/site_acces.log combined
    ErrorLog ${APACHE_LOG_DIR}/site_error.log
</VirtualHost>

Unfortunately, still the same error in my log file, so i disabled the negotiation module ( as mentioned ), but that just gives me this message:

[Tue Feb 24 10:21:02 2015] [error] [client 213.125.184.74] File does not exist: /var/www/vhosts/site.com/webroot/index

After all my modifications to site.conf i did an service apache2 restart and/or service apache2 reload

At this point i have no clue on how to solve this problem so i hope anyone point me in the right direction.

I think "Options Indexes FollowSymLinks Multiviews" is the correct configuration. And yes, you need do "apache reload" after you modify the configuration. Also make sure you accept "php" in content Negotiation. (by default it might not accept)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM