]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/web/server/lilypond.org.htaccess
Merge remote branch 'origin/release/unstable'
[lilypond.git] / Documentation / web / server / lilypond.org.htaccess
1 # htaccess for root dir of lilypond.org
2
3 RewriteEngine On
4
5 # Deny following of symlinks by robots.
6 # HTTrack is a known offender.
7 # better yet, to redirect this to page that tells adminstrator
8 # about brokenness
9 RewriteCond %{HTTP_USER_AGENT} httrack [NC]
10 RewriteRule ^.*/source/.*$ /please-respect-robots.txt.html [L]
11
12 # Permanent top level entry points -- ./doc
13 RedirectMatch ^/music-glossary /doc/Documentation/user/music-glossary/index
14 RedirectMatch ^/tutorial /doc/Documentation/user/lilypond-learning/Tutorial
15 RedirectMatch ^/documentation/$ /doc
16 # Possibly resurrect this with new web site
17 # This breaks the documentation index with old site
18 # RedirectMatch ^/documentation$ /doc
19 RedirectMatch ^/bugs    http://code.google.com/p/lilypond/issues/list
20 RedirectMatch ^/wiki    http://wiki.lilynet.net
21 RedirectMatch ^/authors /doc/Documentation/topdocs/AUTHORS
22 RedirectMatch ^/news    /doc/Documentation/topdocs/NEWS
23 RedirectMatch ^/stable    /doc/stable
24 RedirectMatch ^/development    /doc/development
25
26 #old# default doc dir
27 RedirectMatch ^/doc/*$ /doc/v2.12
28 # make attempt at `latest' symlink avoid ^v catch-all doc fix rule below
29 RedirectMatch ^/doc//*latest/*(.*)$ /doc/v2.13/$1
30 RedirectMatch ^/doc//*development/*(.*)$ /doc/v2.13/$1
31 RedirectMatch ^/doc//*stable/*(.*)$ /doc/v2.12/$1
32 RedirectMatch ^/doc//*([^v].*)$ /doc/v2.12/$1
33 RedirectMatch ^(/Documentation.*)$ /doc/v2.12$1
34 RedirectMatch ^/index$ /
35
36 # fix root calculation: no double slashes
37 # RedirectMatch ^(.*/)/+(.*)$ $1$2
38
39 ###########################################
40
41 ## Rewrite all non-existing files at toplevel to the /web/ dir, so our
42 ## internal structure for rsync doesn't have to be changed.
43 ## This works for the current/old site as well as the new one.
44
45 RewriteEngine on
46 RewriteBase /
47
48 SetEnvIf REQUEST_URI .* WEB=/web
49 ## To switch over to the new site, we do not even need to put it in /web
50 ## we could do
51 # SetEnvIf REQUEST_URI .* WEB=/doc/v2.13/Documentation
52
53 # Rewrite empty to /web
54 RewriteCond %{REQUEST_URI} ^/*$
55 RewriteRule ^(/*)$ %{ENV:WEB}/ [QSA,L]
56
57 # css Request without directory part
58 RewriteCond %{REQUEST_URI} ^/?[^/]+[.]css$
59 # ...that does not match match an existing file
60 RewriteCond %{REQUEST_FILENAME} !-f
61 # ...and does not match an existing directory
62 RewriteCond %{REQUEST_FILENAME} !-d
63 # ...prefix with web
64 RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L]
65
66 # Request without trailing slash
67 RewriteCond %{REQUEST_URI} !.*/$
68 # ...that would access a directory in /web
69 RewriteCond %{DOCUMENT_ROOT}%{ENV:WEB}%{REQUEST_URI} -d
70 # ...and does not start with /web
71 RewriteCond %{REQUEST_URI} !^%{ENV:WEB}
72 RewriteCond %{REQUEST_URI} !^/web
73 # ...and does not start with /doc$
74 RewriteCond %{REQUEST_URI} !^/doc$
75 # ...add trailing slash for [menu] and to avoid /web/ in browser url
76 RewriteRule ^(.+)$ http://%{HTTP_HOST}/$1/ [R,QSA,L]
77
78 # Request that does not start with /web
79 RewriteCond %{REQUEST_URI} !^/web
80 RewriteCond %{REQUEST_URI} !^%{ENV:WEB}
81 # ...and does not start with /doc/
82 RewriteCond %{REQUEST_URI} !^/doc/
83 # ...and is not /doc$
84 RewriteCond %{REQUEST_URI} !^/doc$
85 # ...and does not match match an existing file
86 RewriteCond %{REQUEST_FILENAME} !-f
87 # ...and does not match an existing directory
88 RewriteCond %{REQUEST_FILENAME} !-d
89 # ..prefix with /web
90 RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L]
91
92 ###########################################
93
94 # latin1 version copied to web and doc/2.x
95 AddDefaultCharset utf-8
96 AddCharset utf-8 .html
97 AddCharset utf-8 .de
98 AddCharset utf-8 .en
99 AddCharset utf-8 .es
100 AddCharset utf-8 .fr
101 AddCharset utf-8 .nl
102 AddCharset utf-8 .txt
103
104 # fix broken auto language selection for Hungarian
105 AddLanguage hu .hu
106
107
108
109 # FIXME: separate this from the main "root" .htaccess material
110 DirectoryIndex index
111