我在我的一个项目中对所有 PHP 程序编写了相同的代码行。是否可以在目录的 .htaccess 中执行此操作?如何?
PHP 代码:
Header('Content-Type: application/xhtml+xml; charset=utf-8');
Header("Cache-Control: no-transform");
谢谢任何帮助。
此致。
优素福·阿克约尔
如果您想使用 .htaccess (或在 Apache 配置中)执行此操作,您可以使用Apache 模块 mod_headers http://httpd.apache.org/docs/2.0/mod/mod_headers.html#header, 像这样:
Header set Cache-Control "no-transform"
Header set Content-Type "application/xhtml+xml; charset=utf-8"
搜索htaccess 设置标头 http://www.google.com/search?q=htaccess+set+header为您提供了更多这方面的例子。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)