Search code examples
php.htaccesscgifastcgi

Running an extension less file as php


I was using .htaccess to run an extensionless file as PHP using

<Files thumbs>
        SetHandler application/x-httpd-php
</Files>

but i changed my server to a CGI/FastCGI since then this is not working. I tried online and also here but couldn't find a solution .

Also i tried

<Files "thumbs">
   ForceType application/x-httpd-php
</Files>

Then the file is getting downloaded instead of executing.


Solution

  • Got it fixed by making application/x-httpd-php it as application/x-httpd-php5

    <Files thumbs>
       SetHandler application/x-httpd-php5
    </Files>