How is Apache mapping files without extensions?

9

1

My local dev setup is mapping things like http://mydomain.dev/testhtmlpage to testhtmlpage.html and http://mydomain.dev/testphppage to testphppage.php. The browser stays on the orginally enter URL. The thing is I didn't configure my machine orginally and although I have a decent handle on it now I can't find where this behaviour is being defined.

I've checked my httpd.conf and the two included areas with no luck.

My httpd.conf: http://denishoctor.me/myhttpdconf.xml (view source)

In Include /private/etc/apache2/other/*.conf:

<IfModule php5_module>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

Anyone got any ideas?

Denis Hoctor

Posted 2011-09-20T02:32:43.753

Reputation: 225

Answers

10

This can be caused by a number of things, from rewrite rules to content negotiation. Judging by your httpd.conf, the reason in this particular case is because you have Multiviews turned on.

Excerpt from your config:

Options Indexes FollowSymLinks MultiViews

Change it to this and restart Apache:

Options Indexes FollowSymLinks

John T

Posted 2011-09-20T02:32:43.753

Reputation: 149 037

Thats was it! Thank you. http://httpd.apache.org/docs/2.2/content-negotiation.html#multiviews

– Denis Hoctor – 2011-09-20T03:58:49.150

@DenisHoctor you're most welcome :) – John T – 2011-09-20T04:16:30.437