【发布时间】:2014-12-08 20:36:30
【问题描述】:
在我的主 .htaccess 文件中,我有这个规则:
RewriteCond %{THE_REQUEST} /.+?\.php[\s?] [NC]
RewriteRule ^ - [F]
防止直接访问 php 文件(使用 seo 友好的 url 调用)。
现在我正在处理一个名为
的动态 CSS 代码<link rel="stylesheet" href="theme1/style.php">
有办法允许 style.php 文件并阻止所有其他 .php 文件吗?
PS:同样在我的“theme1”目录中,我还有另一个带有此代码的 htaccess:
<Files *.php>
order allow,deny
deny from all
satisfy all
</Files>
如何编辑这 2 个 .htaccess 文件以只允许 style.php 文件?
【问题讨论】:
-
是什么阻止你在内部重写,例如,将theme1.css 改成theme1/style.php?
标签: php css .htaccess redirect rewrite