0

I have a list of rewrite rules stored in my website's .htaccess file, rewriting URL's like http://example.com/cloud/something to http://example.com/cloud/index.php?page=something.

These rules worked perfectly when I was on a server with Apache 2.4.7, however I'm now working on a server with Apache 2.2.22 (not my choice) and for some reason these rules do not work.

htaccess file:

RewriteEngine On
RewriteBase /cloud/

RewriteCond %{THE_REQUEST} \ /+cloud/(?:index\.php|)\?page=([^&]+)/(&|\ |$)
RewriteRule ^ %1/ [L,R]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [L,QSA]

Whenever I'm trying to access a page with its explicit URL (index.php?page=something) it's working, however trying the short way results in a 404 Page Not Found response.

I checked Apache's error.log file and saw that every time I tried to access one of these URL's a new error appeared:

[error] [client 10.0.0.90] Negotiation: discovered file(s) matching request: /var/www/cloud/settings (None could be negotiated)

What might be the problem? Why isn't it working?

2

This error seems to be caused by MultiViews. Check your central apache configuration and remove the MultiViews directive for this directory and it should work.

Source: http://www.bennadel.com/blog/2218-negotiation-discovered-file-s-matching-request-none-could-be-negotiated.htm

0

For me this was caused by a symlink in the path being redirected to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.