使用htaccess删除https站点的php扩展
我需要删除*.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证书,它不适用
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
,则可能没有任何区别,但值得一试。不幸的是,这也不起作用:(