Forum Moderators: phranque
/directory/page.html/ -- Don't Want
/directory/page.html -- Want
This is the first time we have seen a / show up after .html but we are concerned that more will show up. We have 301's correcting other potential canonical issues but we aren't sure how to stop this particular problem.
Are we missing a setting somewhere in Apache?
[edited by: scraulb at 1:00 am (utc) on Mar. 31, 2009]
Options -MultiViews The first URL given in example above should give a 404 Not Found response if content negotiation is disabled.
[httpd.apache.org...]
[httpd.apache.org...]
Good catch, Scraulb - I hadn't thought of that possibility. If the .html page was being parsed as PHP, that means the trailing slash was, I assume, seen as a variable.
As long as your .html files contain only plain HTML and no PHP, then it's better that they are not handled by the PHP parser - it will only cause extra load for nothing, and also will stop Apache providing proper caching for the static files.
AcceptPathInfo is off
Explicitly set? (since the default is "default", i.e, it's up to the content handler whether to accept or 404 the request).
It's also up to the content handler whether to respect your setting of AcceptPathInfo or not. If the content handler does not handle the setting you can set AcceptPathInfo to off as many times you want; that would be useless.
While AcceptPathInfo is a directive provided by the core, there's no point where the core acts in ap_process_request_internal where path-info is generated (directory walk). It's always up to the content handler which is not part of the ap_process_request_internal logic where most modules run in their registered hooks.
I don't know which handler you use (fastcgi?) but if you set AcceptPathInfo to off, restarted your server, cleared your browser cache and get a 200 ok, your handler doesn't handle the setting.
What is interesting is that we were trying it on 3 servers and the 2 latest Apache servers failed but the older server was fine! None of them had AcceptPathInfo explicitly set on or off.
Another lesson learned, thanks for the help!
John