【发布时间】:2019-04-25 22:36:57
【问题描述】:
为什么“标题”部分中的所有链接都没有重定向? SSL 已添加到页面中。 为什么“标题”部分中的所有链接都没有重定向?
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]
【问题讨论】:
-
您不能使用 htaccess 更改 html 的内容。为此,您需要修复您的页面。
标签: .htaccess https url-rewriting header