Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.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
Apache没有';无法完成https的index.php_Php_Apache_Https - Fatal编程技术网

Apache没有';无法完成https的index.php

Apache没有';无法完成https的index.php,php,apache,https,Php,Apache,Https,当输入例如http://mysite时,服务器返回https://mysite/index.php-这是正确的行为 但当立即开始使用https时: e、 g.https://mysite,服务器只返回https://mysite/(不带index.php)。 但是,站点负载正常。该问题会导致应用程序本身出现一些错误行为。因此,我希望在请求https://时也包含index.php 这是httpd conf文件: # forbid access to the entire filesystem b

当输入例如http://mysite时,服务器返回https://mysite/index.php-这是正确的行为 但当立即开始使用https时: e、 g.https://mysite,服务器只返回https://mysite/(不带index.php)。 但是,站点负载正常。该问题会导致应用程序本身出现一些错误行为。因此,我希望在请求https://时也包含index.php

这是httpd conf文件:

# forbid access to the entire filesystem by default
<Directory />
    Options None
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

<Directory /srv/installateur/content/approot/>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !index.php
    RewriteRule !\.(js|ico|gif|jpg|png|css|swf|pdf|html|csv)$ /index.php [L] 
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    Options Indexes MultiViews SymLinksIfOwnerMatch
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>

# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

# List of resources to look for when the client requests a directory
DirectoryIndex index.php
#默认情况下禁止访问整个文件系统
选项无
不允许超限
命令拒绝,允许
全盘否定
重新启动发动机
重写cond%{REQUEST_URI}!index.php
重写规则!\。(js | ico | gif | jpg | png | css | swf | pdf | html | csv)$/index.php[L]
重写条件%{HTTPS}关闭
重写规则(*)https://%{HTTP\u HOST}%{REQUEST\u URI}
选项索引多视图符号链接所有者匹配
允许超越所有
命令允许,拒绝
通融
#使用.htaccess文件进行覆盖,
AccessFileName.htaccess
#永远不要给他们看
命令允许,拒绝
全盘否定
#客户端请求目录时要查找的资源列表
DirectoryIndex.php


谢谢你的帮助

你不应该那样重写。相反,请执行两个虚拟主机,一个用于http,另一个用于https,并使用301重定向从http重定向到https,同时保留请求参数

请参阅“简单重定向”一节