From 2b7ab5b373a459daa3f39b8ddf592996345f699f Mon Sep 17 00:00:00 2001 From: Federico Bruni Date: Sun, 12 Jan 2014 10:59:21 +0000 Subject: [PATCH] redirect old /web/ to homepage - issue 1272 --- Documentation/web/server/lilypond.org.htaccess | 13 ++++++++----- Documentation/web/server/robots.txt | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Documentation/web/server/lilypond.org.htaccess b/Documentation/web/server/lilypond.org.htaccess index 5e7dfae3d9..d4ba378dbe 100644 --- a/Documentation/web/server/lilypond.org.htaccess +++ b/Documentation/web/server/lilypond.org.htaccess @@ -61,7 +61,7 @@ RedirectMatch ^/index$ / ########################################### -## Rewrite all non-existing files at toplevel to the /web/ dir, so our +## Rewrite all non-existing files at toplevel to the /website/ dir, so our ## internal structure for rsync doesn't have to be changed. ## This works for the current/old site as well as the new one. @@ -70,7 +70,7 @@ RewriteBase / SetEnvIf REQUEST_URI .* WEB=/website -# Rewrite empty to /web +# Rewrite empty to /website RewriteCond %{REQUEST_URI} ^/*$ RewriteRule ^(/*)$ %{ENV:WEB}/ [QSA,L] @@ -80,12 +80,12 @@ RewriteCond %{REQUEST_URI} ^/?[^/]+[.]css$ RewriteCond %{REQUEST_FILENAME} !-f # ...and does not match an existing directory RewriteCond %{REQUEST_FILENAME} !-d -# ...prefix with web +# ...prefix with website RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L] # Request without trailing slash RewriteCond %{REQUEST_URI} !.*/$ -# ...that would access a directory in /web +# ...that would access a directory in /website RewriteCond %{DOCUMENT_ROOT}%{ENV:WEB}%{REQUEST_URI} -d # ...and does not start with /web RewriteCond %{REQUEST_URI} !^%{ENV:WEB} @@ -95,7 +95,7 @@ RewriteCond %{REQUEST_URI} !^/doc$ # ...add trailing slash for [menu] and to avoid /web/ in browser url RewriteRule ^(.+)$ http://%{HTTP_HOST}/$1/ [R,QSA,L] -# Request that does not start with /web +# Request that does not start with /website RewriteCond %{REQUEST_URI} !^/website RewriteCond %{REQUEST_URI} !^%{ENV:WEB} # ...and does not start with /doc/ @@ -109,6 +109,9 @@ RewriteCond %{REQUEST_FILENAME} !-d # ..prefix with /web RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L] +## Redirect the old web/ to the homepage +RedirectMatch 301 /web/* / + ########################################### # latin1 version copied to web and doc/2.x diff --git a/Documentation/web/server/robots.txt b/Documentation/web/server/robots.txt index ccc8ed800d..8213d0e215 100644 --- a/Documentation/web/server/robots.txt +++ b/Documentation/web/server/robots.txt @@ -21,3 +21,5 @@ Disallow: /doc/v2.12/ Disallow: /doc/v2.13/ Disallow: /doc/v2.14/ Disallow: /doc/v2.15/ + +Disallow: /web/ -- 2.39.2