Merge pull request #3281 from fuchunlan/remove-doc-1

fix: Disable doc url
This commit is contained in:
yonghongshi 2025-07-31 11:33:16 +08:00 committed by GitHub
commit c9d3f06cb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 0 deletions

View File

@ -1,3 +1,24 @@
{{ $disabled := or (hasPrefix .RelPermalink "/zh/docs/v3.3")
(hasPrefix .RelPermalink "/zh/docs/v3.4")
(hasPrefix .RelPermalink "/zh/docs/v4.1")
(hasPrefix .RelPermalink "/docs/v3.3")
(hasPrefix .RelPermalink "/docs/v3.4")
(hasPrefix .RelPermalink "/docs/v4.1") }}
{{ if $disabled }}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; url=/404.html">
<script>window.location = '/404.html';</script>
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="Cache-Control" content="no-store">
</head>
<body></body>
</html>
{{ return }}
{{ end }}
<!DOCTYPE html>
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}">

View File

@ -28,3 +28,17 @@
status = 301
force = true
[[redirects]]
from = "^/(zh/)?docs/(v3\\.3|v3\\.4|v4\\.1)(/.*)?$"
to = "/404.html"
status = 404
force = true
conditions = { Role = "all" }
[[headers]]
for = "^(/zh)?/docs/(v3\\.3|v3\\.4|v4\\.1)(/.*)?$"
[headers.values]
Cache-Control = "no-store, max-age=0"
X-Robots-Tag = "noindex, nofollow"