We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50407e8 commit 75c4f4bCopy full SHA for 75c4f4b
layouts/home.apache_htaccess
@@ -16,12 +16,13 @@ ErrorDocument 404 /404.html
16
17
<IfModule mod_rewrite.c>
18
RewriteEngine On
19
+{{- $siteUrl := urls.Parse site.BaseURL }}
20
{{- $redirectMap := partial "collect-redirects.html" . }}
21
{{- range $status, $redirects := $redirectMap }}
22
{{- if reflect.IsMap $redirects }}
23
{{- range $from, $to := $redirects }}
24
{{- $url := urls.Parse $from }}
- {{- if $url.Scheme }}
25
+ {{- if and $url.Scheme (ne $siteUrl.Host $url.Host) }}
26
RewriteCond %{HTTP_HOST} ^{{ $url.Host }}$
27
RewriteRule (.*) {{ site.BaseURL }}$1 [QSA,END,R=301]
28
{{- end }}
0 commit comments