0

How can I add PHP to deal with files that do not have any extension? Is there a "DefaultHandler" directive? In Apache 2.2.29, with PHP 5.5, the following does not work:

DefaultType application/x-httpd-php
DefaultType application/x-httpd-php55

Neither of those two work. In Apache 2.2.21 with PHP 5.3, the first directive used to work without any glitches. Google has yielded nothing. Thank you for any pointers!

1 Answer 1

1

Check ForceType, You have examples of usage in the manual page. Wrap the directive in <FilesMatch REGEX> block, with regular expression matching ie. files without a dot (thus not having an extension).

Anyway, consider leaving PHP files with proper extensions and using mod_rewrite for better looking URIs.

1
  • Thank you. ForceType is the perfect answer with None as an option for files with extensions. In the future we will probably just use PHP extension and use rewrite rules.
    – PKHunter
    Jul 30, 2015 at 15:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .