使用htaccess删除https站点的php扩展

时间:2014-10-23 00:27:34

标签: php .htaccess https configure

我有以下内容删除* .php扩展名:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

RewriteCond %{REQUEST_URI} index\.php
RewriteRule ^(.*)index\.php$ $1 [R=301,L]

问题是,现在我已经安装了ssl证书,但它不适用于子目录。

https://www.site.com WORKING(200)
https://www.site.com/example NOT WORKING (404)
https://www.site.com/example.php WORKING(200)

有人能帮助我吗?

1 个答案:

答案 0 :(得分:1)

在尝试了几乎所有可能的解决方法之后,我终于找到了解决方案。 只需将其添加到我的ssl站点的配置文件中:

<Directory path/to/your/site>
  AllowOverride FileInfo
</Directory>

更多信息here