Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.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
Ubuntu 缺少到HTTPS的重定向_Ubuntu_Ssl_Apache2 - Fatal编程技术网

Ubuntu 缺少到HTTPS的重定向

Ubuntu 缺少到HTTPS的重定向,ubuntu,ssl,apache2,Ubuntu,Ssl,Apache2,我用Let's encrypt在我的LAMP上安装SSL证书。我想通过HTTPS重定向我的所有域。 现在它可以工作了,但还不能完全工作 重定向到(证书工作) 不要重定向到https://,而是直接(证书有效) 这是我的.htaccess文件 RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L] 我修复了这个线程的问题 我在/etc/apache

我用Let's encrypt在我的LAMP上安装SSL证书。我想通过HTTPS重定向我的所有域。 现在它可以工作了,但还不能完全工作

重定向到(证书工作)
不要重定向到https://,而是直接(证书有效)

这是我的.htaccess文件

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]

我修复了这个线程的问题

我在/etc/apache2/apache2.conf中设置了

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride All
    Require all granted
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>


选项如下符号链接
允许超越所有
要求全部拒绝
允许超越所有
要求所有授权
选项索引跟随符号链接
允许超越所有
要求所有授权
All允许从“无”转换为“全部”,并重新启动Apache2服务