htaccess的MIME类型 [英] htaccess mime type
本文介绍了htaccess的MIME类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们的目标是创建一个自定义的文件扩展名使用的.htaccess我* .PHP的测试脚本,我想自定义文件扩展名,这样,当Apache2的看,那么Apache会执行它像一个PHP脚本。吹是一个例子
The goal is to create a customized file extension for my *.php test script using .htaccess, I would like to customize a file extension so that when Apache2 "sees" it, then Apache will execute it like a PHP script. Blow is an example
测试网址为:
localhost/index.xyz
htaccess的是目录WWW并且为1行:
the .htaccess is at directory www and is one line:
AddType application/x-httpd-php5 xyz
php文件,test.xyz跑是:
the php file, "test.xyz" to run is:
<?php
echo "hello, I am a xyz file...";
我怎么能做到这一点?
How could I accomplish this?
推荐答案
尝试
AddHandler application/x-httpd-php .xyz
这篇关于htaccess的MIME类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文