简体   繁体   English

ICS扩展为Apache2的PHP

[英]ICS extension as PHP with Apache2

I am trying to serve up an ics (ical) file via a url. 我正在尝试通过网址提供一个ics(ical)文件。 Accessing my "ical.php" is fine. 访问我的“ ical.php”就可以了。 But many apps insist the url has a .ics extension. 但是许多应用程序坚持认为URL具有.ics扩展名。 If I symlink "shamrock.ics" to ical.php then the raw php file is served up. 如果我将“ shamrock.ics”符号链接到ical.php,则原始php文件将被提供。 I found a rewrite rule elsewhere in stackoverflow (RewriteRule ^(.*).ics$ $1.php [QSA]) but this doesnt work for me (other rewrites I use do work so I know the rewrite engine works). 我在stackoverflow的其他地方找到了重写规则(RewriteRule ^(。*)。ics $ $ 1.php [QSA]),但这对我不起作用(我使用的其他重写也可以工作,所以我知道重写引擎可以工作)。

Can someone suggest the next step or the best path to take to solve this. 有人可以建议下一步或解决此问题的最佳途径。

I found the solution. 我找到了解决方案。 And its not using rewrites. 并且它不使用重写。 Simply add "AddType application/x-httpd-php .php .phtml .html .htm .ics" to the httpd.conf. 只需将“ AddType application / x-httpd-php .php .phtml .html .htm .ics”添加到httpd.conf。 I should have found that. 我应该发现的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM