Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用htaccess删除https站点的php扩展_Php_.htaccess_Https_Configure - Fatal编程技术网

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

使用htaccess删除https站点的php扩展,php,.htaccess,https,configure,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证书,它不适用

我需要删除*.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)

有人能帮我吗?

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

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

AllowOverride文件信息

更多信息

很抱歉回答错误,我的回答不好。没问题!谢谢你的帮助:)它不起作用。。。如果我尝试使用https访问子目录,那么我会得到404(找不到页面)是否在主机上默认启用了
+FollowSymLinks
?如果不在文件开头使用
选项+FollowSymLinks
,则可能没有任何区别,但值得一试。不幸的是,这也不起作用:(