Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/226.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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
Php 拉威尔:重定向到https://www.***在Firefox中不起作用?_Php_.htaccess_Laravel 5 - Fatal编程技术网

Php 拉威尔:重定向到https://www.***在Firefox中不起作用?

Php 拉威尔:重定向到https://www.***在Firefox中不起作用?,php,.htaccess,laravel-5,Php,.htaccess,Laravel 5,我将此代码添加到.htaccess文件中,以将我的网站始终重定向到https://www.**********。这在Chrome中有效,但在Firefox中不起作用 如果我进去 https://example.com 那么它就不会重定向到任何地方 在Firefox中。在Chrome中,它们被正确重定向到https://www.example.com 我删除了缓存,并试图从其他电脑上调用该网站,但它仍然无法工作。这是我从Laravel获得的htaccess文件: <IfModule mod

我将此代码添加到.htaccess文件中,以将我的网站始终重定向到
https://www.**********
。这在Chrome中有效,但在Firefox中不起作用

如果我进去

https://example.com
那么它就不会重定向到任何地方

在Firefox中。在Chrome中,它们被正确重定向到
https://www.example.com

我删除了缓存,并试图从其他电脑上调用该网站,但它仍然无法工作。这是我从Laravel获得的htaccess文件:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On


    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    RewriteCond %{HTTPS} off
    # First rewrite to HTTPS:
    # Don't put www. here. If it is already there it will be included, if not
    # the subsequent rule will catch it.
    RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    # Now, rewrite any request to the wrong domain to use www.
    # [NC] is a case-insensitive match
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

</IfModule>

选项-多视图-索引
重新启动发动机
#句柄授权头
RewriteCond%{HTTP:Authorization}。
重写规则。*-[E=HTTP\U授权:%{HTTP:AUTHORIZATION}]
#如果不是文件夹,则重定向尾部斜杠。。。
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_URI}(+)/$
重写规则^1[L,R=301]
#处理前控制器。。。
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^index.php[L]
重写条件%{HTTPS}关闭
#首先重写到HTTPS:
#不要把www.放在这里。如果已经存在,将包括在内,如果没有
#随后的规则将捕获它。
重写规则。*https://%{HTTP_HOST}%{REQUEST_URI}[L,R=301]
#现在,将任何请求重写到错误的域以使用www。
#[NC]是不区分大小写的匹配项
重写cond%{HTTP_HOST}^www\。[北卡罗来纳州]
重写规则。*https://www.%{HTTP_HOST}%{REQUEST_URI}[L,R=301]

我做错了什么?

有关问题的答案,请参见下面的评论。

问题是,我只有域www.example.org的SSL证书,而没有域example.org的SSL证书。因此,url无效,未加载,无法使用
.htaccess
文件重定向。

那么你是说这在firefox中不起作用?请确保不仅为https而且为www安装了SSL。在firefox中为我工作的域,您必须错误地为httpsI安装了cert,并且只为
https://www.***
这就是为什么我首先希望重定向到www页面如果您输入
https://coaching-institutes.net
在您的浏览器中?我在其他电脑上也试过,但不起作用。你在Firefox的私有模式下试过吗?@Karolis是的,在私有模式下和其他电脑上(Windows7和ubuntu)。重定向仍在发生,url为coaching-institutes.net