Treat .htm files as PHP?

Michael Shadle mike503 at gmail.com
Thu Jul 2 21:23:16 MSD 2009


That's how I have mine setup. No need to hardcode the root in twice!

Sent from my iPhone

On Jul 2, 2009, at 3:05 AM, John Moore <grails at jmsd.co.uk> wrote:

> Phillip Oldham wrote:
>> John Moore wrote:
>>> Michael Shadle wrote:
>>>> Should be as simple as changing a php block and changing the  
>>>> extension to htm and passing it on to fastcgi like normal. I think.
>>> Hmm, I'm not sure I quite understand what you mean here. Could you  
>>> perhaps give me an example? When I did what I think you meant, I  
>>> got an error page saying 'No input file specified'.
>>>
>>> Thx.
>> Follow this: http://wiki.nginx.org/NginxFcgiExample - and just  
>> change the location block so it checks for .html instead of .php.
>>
>> More details can be found here:
>> http://wiki.nginx.org/NginxConfiguration
>> http://wiki.nginx.org/NginxHttpFcgiModule
>>
>>
>>
> Thanks. My problem was that while PHP was working generally, I  
> couldn't get it to work for the specific domain. I realized that I  
> was misinforming FastCGI about the location, with this line:
>
> fastcgi_param SCRIPT_FILENAME /var/www/nginx-default 
> $fastcgi_script_name;
>
> Changing it to this solved my problem:
>
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
>
> Thanks for the help.
>





More information about the nginx mailing list