]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/web/server/lilypond.org.htaccess
Merge branch 'lilypond/translation'
[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 RedirectMatch ^/development    /doc/development
23
24 #old# default doc dir
25 RedirectMatch ^/doc/*$ /doc/v2.12
26 # make attempt at `latest' symlink avoid ^v catch-all doc fix rule below
27 RedirectMatch ^/doc//*latest/*(.*)$ /doc/v2.13/$1
28 RedirectMatch ^/doc//*development/*(.*)$ /doc/v2.13/$1
29 RedirectMatch ^/doc//*stable/*(.*)$ /doc/v2.12/$1
30 RedirectMatch ^/doc//*([^v].*)$ /doc/v2.12/$1
31 RedirectMatch ^(/Documentation.*)$ /doc/v2.12$1
32 RedirectMatch ^/index$ /
33
34 # fix root calculation: no double slashes
35 # RedirectMatch ^(.*/)/+(.*)$ $1$2
36
37 ###########################################
38
39 ## Rewrite all non-existing files at toplevel to the /web/ dir, so our
40 ## internal structure for rsync doesn't have to be changed.
41 ## This works for the current/old site as well as the new one.
42
43 RewriteEngine on
44 RewriteBase /
45
46 SetEnvIf REQUEST_URI .* WEB=/web
47 ## To switch over to the new site, we do not even need to put it in /web
48 ## we could do
49 # SetEnvIf REQUEST_URI .* WEB=/doc/v2.13/Documentation
50
51 # Rewrite empty to /web
52 RewriteCond %{REQUEST_URI} ^/*$
53 RewriteRule ^(/*)$ %{ENV:WEB}/ [QSA,L]
54
55 # css Request without directory part
56 RewriteCond %{REQUEST_URI} ^/?[^/]+[.]css$
57 # ...that does not match match an existing file
58 RewriteCond %{REQUEST_FILENAME} !-f
59 # ...and does not match an existing directory
60 RewriteCond %{REQUEST_FILENAME} !-d
61 # ...prefix with web
62 RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L]
63
64 # Request without trailing slash
65 RewriteCond %{REQUEST_URI} !.*/$
66 # ...that would access a directory in /web
67 RewriteCond %{DOCUMENT_ROOT}%{ENV:WEB}%{REQUEST_URI} -d
68 # ...and does not start with /web
69 RewriteCond %{REQUEST_URI} !^%{ENV:WEB}
70 RewriteCond %{REQUEST_URI} !^/web
71 # ...and does not start with /doc$
72 RewriteCond %{REQUEST_URI} !^/doc$
73 # ...add trailing slash for [menu] and to avoid /web/ in browser url
74 RewriteRule ^(.+)$ http://%{HTTP_HOST}/$1/ [R,QSA,L]
75
76 # Request that does not start with /web
77 RewriteCond %{REQUEST_URI} !^/web
78 RewriteCond %{REQUEST_URI} !^%{ENV:WEB}
79 # ...and does not start with /doc/
80 RewriteCond %{REQUEST_URI} !^/doc/
81 # ...and is not /doc$
82 RewriteCond %{REQUEST_URI} !^/doc$
83 # ...and does not match match an existing file
84 RewriteCond %{REQUEST_FILENAME} !-f
85 # ...and does not match an existing directory
86 RewriteCond %{REQUEST_FILENAME} !-d
87 # ..prefix with /web
88 RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L]
89
90 ###########################################
91
92 # latin1 version copied to web and doc/2.x
93 AddDefaultCharset utf-8
94 AddCharset utf-8 .html
95 AddCharset utf-8 .de
96 AddCharset utf-8 .en
97 AddCharset utf-8 .es
98 AddCharset utf-8 .fr
99 AddCharset utf-8 .nl
100 AddCharset utf-8 .txt
101
102 # fix broken auto language selection for Hungarian
103 AddLanguage hu .hu