为什么“标题”部分中的所有链接都没有重定向?

时间:2018-11-23 10:08:22

标签: .htaccess https url-rewriting header

SSL已添加到页面。 为什么“标题”部分中的所有链接都没有重定向?

enter image description here

enter image description here

...

RewriteEngine On

RewriteCond %{QUERY_STRING} .
RewriteRule ^(.*)$ /$1? [R,L]

#RewriteCond %{HTTP_HOST} !^(www\.)?example\.com$ [NC]
#RewriteRule ^ - [F,L]
#RewriteCond %{HTTP_HOST} !^www\. [NC]
#RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


RewriteCond %{HTTP_HOST} ^example.pl$ [OR]
RewriteCond %{HTTP_HOST} ^www.example.pl$
RewriteRule ^(.*) https://example.com/pl [QSA,L,R=301]

RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} !^example\.pl$
RewriteCond %{HTTP_HOST} !^example\.eu$
RewriteCond %{HTTP_HOST} !^example\.com$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\.example\.pl$
RewriteCond %{HTTP_HOST} !^example\.pl$
RewriteCond %{HTTP_HOST} !^www\.example\.eu$
RewriteCond %{HTTP_HOST} !^example\.eu$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTP_HOST} ^www.example.eu$ [OR]
RewriteCond %{HTTP_HOST} ^example.eu$  
RewriteRule ^(.*) https://example.com/$1 [QSA,L,R=301]

RewriteCond %{HTTP_HOST} ^www.example.com$ [OR]
RewriteRule ^(.*) https://example.com/$1 [QSA,L,R=301]

...

1 个答案:

答案 0 :(得分:0)

这是我的代码的一部分:

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="alternate" href="{{ config('app.url') }}" hreflang="x-default" />
    <link rel="alternate" href="{{ LaravelLocalization::getLocalizedURL('pl',  Request::url()) }}" hreflang="pl-PL" />
    <link rel="alternate" href="{{ LaravelLocalization::getLocalizedURL('en',  Request::url()) }}" hreflang="en-US" />
    <link rel="alternate" href="{{ LaravelLocalization::getLocalizedURL('de',  Request::url()) }}" hreflang="de-DE" />
    <link rel="alternate" href="{{ LaravelLocalization::getLocalizedURL('ru',  Request::url()) }}" hreflang="ru-RU" />

    <link rel="canonical" href="{{Request::url()}}" /> 


    @widget('meta')
    <!-- Fonts -->
    <!--        <link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
            <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700,700i&amp;subset=latin-ext" rel="stylesheet">
            <link href="https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i&amp;subset=latin-ext" rel="stylesheet"> -->

    <link href="/plugins/twentytwenty-master/css/twentytwenty.css" rel="stylesheet" async>
    <link href="/css/animateslider.css" rel="stylesheet" async>

    <link href="{{ asset('css/fonts.css') }}" rel="stylesheet">

    <link href="{{ asset('css/fontawesome-all.min.css') }}" rel="stylesheet">
    <link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet">
    <link href="{{ asset('css/style.min.css') }}" rel="stylesheet">
    <link href="{{ asset('css/mobile.min.css') }}" rel="stylesheet">
    <link href="{{ asset('css/submenu.min.css') }}" rel="stylesheet">
    <link href="{{ asset('css/flags.min.css') }}" rel="stylesheet">
    <link href="{{ asset('css/component.min.css') }}" rel="stylesheet">
    <link href="{{ asset('lib/slippry/slippry.css') }}" rel="stylesheet">