3 # Deny following of symlinks by robots.
4 # HTTrack is a known offender.
5 # better yet, to redirect this to page that tells adminstrator
7 RewriteCond %{HTTP_USER_AGENT} httrack [NC]
8 RewriteRule ^.*/source/.*$ /please-respect-robots.txt.html [L]
10 # Permanent top level entry points -- ./doc
11 RedirectMatch ^/music-glossary /doc/Documentation/user/music-glossary/index
12 RedirectMatch ^/tutorial /doc/Documentation/user/lilypond-learning/Tutorial
13 RedirectMatch ^/documentation/$ /doc
14 # Possibly resurrect this with new web site
15 # This breaks the documentation index with old site
16 # RedirectMatch ^/documentation$ /doc
17 RedirectMatch ^/bugs http://code.google.com/p/lilypond/issues/list
18 RedirectMatch ^/wiki http://wiki.lilynet.net
19 RedirectMatch ^/authors /doc/Documentation/topdocs/AUTHORS
20 RedirectMatch ^/news /doc/Documentation/topdocs/NEWS
21 RedirectMatch ^/stable /doc/stable
24 RedirectMatch ^/doc/*$ /doc/v2.12
25 # make attempt at `latest' symlink avoid ^v catch-all doc fix rule below
26 RedirectMatch ^/doc//*latest/*(.*)$ /doc/v2.13/$1
27 RedirectMatch ^/doc//*development/*(.*)$ /doc/v2.13/$1
28 RedirectMatch ^/doc//*stable/*(.*)$ /doc/v2.12/$1
29 RedirectMatch ^/doc//*([^v].*)$ /doc/v2.12/$1
30 RedirectMatch ^(/Documentation.*)$ /doc/v2.12$1
31 RedirectMatch ^/index$ /
33 # fix root calculation: no double slashes
34 # RedirectMatch ^(.*/)/+(.*)$ $1$2
36 ###########################################
38 ## Rewrite all non-existing files at toplevel to the /web/ dir, so our
39 ## internal structure for rsync doesn't have to be changed.
40 ## This works for the current/old site as well as the new one.
45 SetEnvIf REQUEST_URI .* WEB=/web
46 ## To switch over to the new site, we do not even need to put it in /web
48 # SetEnvIf REQUEST_URI .* WEB=/doc/v2.13/Documentation
50 # Rewrite empty to /web
51 RewriteCond %{REQUEST_URI} ^/*$
52 RewriteRule ^(/*)$ %{ENV:WEB}/ [QSA,L]
54 # css Request without directory part
55 RewriteCond %{REQUEST_URI} ^/?[^/]+[.]css$
56 # ...that does not match match an existing file
57 RewriteCond %{REQUEST_FILENAME} !-f
58 # ...and does not match an existing directory
59 RewriteCond %{REQUEST_FILENAME} !-d
61 RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L]
63 # Request without trailing slash
64 RewriteCond %{REQUEST_URI} !.*/$
65 # ...that would access a directory in /web
66 RewriteCond %{DOCUMENT_ROOT}%{ENV:WEB}%{REQUEST_URI} -d
67 # ...and does not start with /web
68 RewriteCond %{REQUEST_URI} !^%{ENV:WEB}
69 RewriteCond %{REQUEST_URI} !^/web
70 # ...and does not start with /doc$
71 RewriteCond %{REQUEST_URI} !^/doc$
72 # ...add trailing slash for [menu] and to avoid /web/ in browser url
73 RewriteRule ^(.+)$ http://%{HTTP_HOST}/$1/ [R,QSA,L]
75 # Request that does not start with /web
76 RewriteCond %{REQUEST_URI} !^/web
77 RewriteCond %{REQUEST_URI} !^%{ENV:WEB}
78 # ...and does not start with /doc/
79 RewriteCond %{REQUEST_URI} !^/doc/
81 RewriteCond %{REQUEST_URI} !^/doc$
82 # ...and does not match match an existing file
83 RewriteCond %{REQUEST_FILENAME} !-f
84 # ...and does not match an existing directory
85 RewriteCond %{REQUEST_FILENAME} !-d
87 RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L]
89 ###########################################
91 # latin1 version copied to web and doc/2.x
92 AddDefaultCharset utf-8
93 AddCharset utf-8 .html
101 # fix broken auto language selection for Hungarian