开发者

How do I assign file extensions a particular parser using htaccess?

开发者 https://www.devze.com 2022-12-12 13:48 出处:网络
Suppose I wanted to have all files named \".myexcellentpage\"开发者_运维问答 to be parsed with PHP, or with Perl, or as HTML, or what have you. What do I have to do in htaccess to achieve this?AddType

Suppose I wanted to have all files named ".myexcellentpage"开发者_运维问答 to be parsed with PHP, or with Perl, or as HTML, or what have you. What do I have to do in htaccess to achieve this?


AddType application/x-httpd-php5 .mybogusextension    
AddHandler cgi-script .myotherextension


For PHP, the following AddType should work:

AddType application/x-httpd-php .myexcellentpage

(You can specify php4 or php5 explicitly if desired.)

For other things, like Perl CGI, the AddHandler directive can be used to specify the handler.

0

精彩评论

暂无评论...
验证码 换一张
取 消