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