Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.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无法重定向www问题NET::ERR\u CERT\u AUTHORITY\u无效_Apache_Symfony_Redirect_Url Rewriting_Apache2 - Fatal编程技术网

Apache无法重定向www问题NET::ERR\u CERT\u AUTHORITY\u无效

Apache无法重定向www问题NET::ERR\u CERT\u AUTHORITY\u无效,apache,symfony,redirect,url-rewriting,apache2,Apache,Symfony,Redirect,Url Rewriting,Apache2,我的网站有一些问题。当我输入不带www的url地址时,出现错误“您的连接不是私有的..NET::ERR\u CERT\u AUTHORITY\u INVALID”。 所以我尝试用www重定向到url,但重定向不起作用。 它在symfony5框架上的应用 <VirtualHost *:80> ServerAdmin email@example.com ServerName example.com Redirect permanent / http://www.e

我的网站有一些问题。当我输入不带www的url地址时,出现错误“您的连接不是私有的..NET::ERR\u CERT\u AUTHORITY\u INVALID”。 所以我尝试用www重定向到url,但重定向不起作用。 它在symfony5框架上的应用

<VirtualHost *:80>
    ServerAdmin email@example.com
    ServerName example.com
    Redirect permanent / http://www.example.com/
    ServerAlias www.example.com
    ServerSignature Off
    DocumentRoot /var/www/release.example/public
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    DirectoryIndex index.php

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

<FilesMatch \.php$>
# For Apache version 2.4.10 and above, use SetHandler to run PHP as a fastCGI process server
    SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost"
</FilesMatch>

RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com [OR]
RewriteCond %{SERVER_NAME} =www.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>





<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerAdmin email@example.com
    ServerName example.com
    ServerAlias www.example.com
    ServerSignature Off
    DocumentRoot /var/www/release.example/public
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    DirectoryIndex index.php

<Directory /var/www/release.example/public>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

<FilesMatch \.php$>
# For Apache version 2.4.10 and above, use SetHandler to run PHP as a fastCGI process server
    SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost"
</FilesMatch>


Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
</VirtualHost>
</IfModule>

服务器管理员email@example.com
ServerName example.com
重定向永久/http://www.example.com/
ServerAlias www.example.com
服务器签名关闭
DocumentRoot/var/www/release.example/public
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
DirectoryIndex.php
选项如下符号链接
允许超越所有
要求所有授权
#对于Apache 2.4.10及更高版本,请使用SetHandler将PHP作为fastCGI进程服务器运行
SetHandler“proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost"
重新启动发动机
RewriteCond%{SERVER_NAME}=example.com[或]
RewriteCond%{SERVER_NAME}=www.example.com
重写规则^https://%{SERVER_NAME}%{REQUEST_URI}[END,NE,R=permanent]
服务器管理员email@example.com
ServerName example.com
ServerAlias www.example.com
服务器签名关闭
DocumentRoot/var/www/release.example/public
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
DirectoryIndex.php
选项如下符号链接
允许超越所有
要求所有授权
#对于Apache 2.4.10及更高版本,请使用SetHandler将PHP作为fastCGI进程服务器运行
SetHandler“proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost"
Include/etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile/etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile/etc/letsencrypt/live/example.com/privkey.pem

您想要的结果是什么?您拥有哪个主机名的证书?是自己签名的吗?因为警告/错误是默认的,所以我的结果是从example.com重定向到。