I've tested that the redirects work on my own httpd server, and have
verified that no new sphinx-generated docs match these patterns, and no
old texinfo docs fail to match them (except for cases like index.html
where a new file exists with the same name anyway so we don't need a
redirect).

For example, on gcc.gnu.org:

cd htdocs/onlinedocs/gcc-12.2.0

# All "missing" URLs are matched by these patterns:

for i in {gcc,cpp}/*.html ; do test -f ../$i || echo $i ; done | grep -E -v 
'^(gcc|cpp)/([[:upper:]].*|_00(5f|40).*|aarch64-feature-modifiers|c99-like-fast-enumeration-syntax|compatibility_005f.*|dashMF|eBPF-Options|fdollars-in-identifiers|lto-dump-Intro|(m68k|msp430|picoChip|x86|zSeries).*|trigraphs).*\.html$'

for i in gccint/*.html ; do test -f ../$i || echo $i ; done | grep -E -v 
'^gccint/([[:upper:]].*|(arm|define|input|poly|stack|window)_005f.*|compat-Testing|(epi|pro)logue-instruction-pattern|gcc-Directory|gcov-Testing|loop-iv|profopt-Testing|real-RTL-SSA-insns|shift-patterns|wi-arith.*)\.html$'

for i in cppinternals/*.html ; do test -f ../$i || echo $i ; done | grep -E -v 
'^cppinternals/([[:upper:]].*)\.html$'


# No still-valid URLs are matched:

for i in {gcc,cpp}/*.html ; do test -f ../$i && echo $i ; done | grep -E 
'^(gcc|cpp)/([[:upper:]].*|_00(5f|40).*|aarch64-feature-modifiers|c99-like-fast-enumeration-syntax|compatibility_005f.*|dashMF|eBPF-Options|fdollars-in-identifiers|lto-dump-Intro|(m68k|msp430|picoChip|x86|zSeries).*|trigraphs).*\.html$'

for i in gccint/*.html ; do test -f ../$i && echo $i ; done | grep -E 
'^gccint/([[:upper:]].*|(arm|define|input|poly|stack|window)_005f.*|compat-Testing|(epi|pro)logue-instruction-pattern|gcc-Directory|gcov-Testing|loop-iv|profopt-Testing|real-RTL-SSA-insns|shift-patterns|wi-arith.*)\.html$'

for i in  cppinternals/*.html ; do test -f ../$i && echo $i ; done | grep -E 
'^cppinternals/([[:upper:]].*)\.html$'


I haven't added redirects for other sub-dirs such as gccgo, gfortran,
libgomp etc. so if somebody cares about those, they should deal with
them.

OK for wwwdocs?

-- >8 --

Add redirects from /onlinedocs/gcc-X to the latest gcc-X.Y.0 release
(which will need to be updated when a release is made).

Also add redirects from URLs for old trunk docs such as
https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html
to the gcc-12 equivalent of that page.
---
 htdocs/.htaccess | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/htdocs/.htaccess b/htdocs/.htaccess
index 18997d63..bf7124ea 100644
--- a/htdocs/.htaccess
+++ b/htdocs/.htaccess
@@ -79,3 +79,17 @@ Redirect           /onlinedocs/libc          
https://www.gnu.org/software/libc/manual/ht
 Redirect           /onlinedocs/standards       
https://www.gnu.org/prep/standards/html_node/
 
 Redirect           /onlinedocs/ref             
https://gcc.gnu.org/onlinedocs/gcc-4.3.2/
+
+Redirect           /onlinedocs/gcc-5/           
https://gcc.gnu.org/onlinedocs/gcc-5.5.0/
+Redirect           /onlinedocs/gcc-6/           
https://gcc.gnu.org/onlinedocs/gcc-6.5.0/
+Redirect           /onlinedocs/gcc-7/           
https://gcc.gnu.org/onlinedocs/gcc-7.5.0/
+Redirect           /onlinedocs/gcc-8/           
https://gcc.gnu.org/onlinedocs/gcc-8.5.0/
+Redirect           /onlinedocs/gcc-9/           
https://gcc.gnu.org/onlinedocs/gcc-9.5.0/
+Redirect           /onlinedocs/gcc-10/          
https://gcc.gnu.org/onlinedocs/gcc-10.4.0/
+Redirect           /onlinedocs/gcc-11/          
https://gcc.gnu.org/onlinedocs/gcc-11.3.0/
+Redirect           /onlinedocs/gcc-12/          
https://gcc.gnu.org/onlinedocs/gcc-12.2.0/
+
+# Redirect URLs for old texinfo trunk docs to gcc-12
+RedirectMatch permanent 
/onlinedocs/(gcc|cpp)/([[:upper:]].*|_00(5f|40).*|aarch64-feature-modifiers|c99-like-fast-enumeration-syntax|compatibility_005f.*|dashMF|eBPF-Options|fdollars-in-identifiers|lto-dump-Intro|(m68k|msp430|picoChip|x86|zSeries).*|trigraphs).*\.html$
 https://gcc.gnu.org/onlinedocs/gcc-12/$1/$2.html
+RedirectMatch permanent 
/onlinedocs/gccint/([[:upper:]].*|(arm|define|input|poly|stack|window)_005f.*|compat-Testing|(epi|pro)logue-instruction-pattern|gcc-Directory|gcov-Testing|loop-iv|profopt-Testing|real-RTL-SSA-insns|shift-patterns|wi-arith.*)\.html$
 https://gcc.gnu.org/onlinedocs/gcc-12/gccint/$1.html
+RedirectMatch permanent /onlinedocs/cppinternals/([[:upper:]].*)\.html$ 
https://gcc.gnu.org/onlinedocs/gcc-12/gccint/$1.html
-- 
2.38.1

Reply via email to