]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/web/server/lilypond.org.htaccess
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / Documentation / web / server / lilypond.org.htaccess
1 RewriteEngine On
2
3 # Deny following of symlinks by robots.
4 # HTTrack is a known offender.
5 # better yet, to redirect this to page that tells adminstrator
6 # about brokenness
7 RewriteCond %{HTTP_USER_AGENT} httrack [NC]
8 RewriteRule ^.*/source/.*$ /please-respect-robots.txt.html [L]
9
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
22
23 #old# default doc dir
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$ /
32
33 # fix root calculation: no double slashes
34 # RedirectMatch ^(.*/)/+(.*)$ $1$2
35
36 ###########################################
37
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.
41
42 RewriteEngine on
43 RewriteBase /
44
45 SetEnvIf REQUEST_URI .* WEB=/web
46 ## To switch over to the new site, we do not even need to put it in /web
47 ## we could do
48 # SetEnvIf REQUEST_URI .* WEB=/doc/v2.13/Documentation
49
50 # Rewrite empty to /web
51 RewriteCond %{REQUEST_URI} ^/*$
52 RewriteRule ^(/*)$ %{ENV:WEB}/ [QSA,L]
53
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
60 # ...prefix with web
61 RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L]
62
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]
74
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/
80 # ...and is not /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
86 # ..prefix with /web
87 RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L]
88
89 ###########################################
90
91 # latin1 version copied to web and doc/2.x
92 AddDefaultCharset utf-8
93 AddCharset utf-8 .html
94 AddCharset utf-8 .de
95 AddCharset utf-8 .en
96 AddCharset utf-8 .es
97 AddCharset utf-8 .fr
98 AddCharset utf-8 .nl
99 AddCharset utf-8 .txt
100
101 # fix broken auto language selection for Hungarian
102 AddLanguage hu .hu