]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/web/server/lilypond.org.htaccess
Web server: don't redirect /development.
[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 # the new website has a dedicated page for development.
43 #RedirectMatch ^/development    /doc/development
44
45 #old# default doc dir
46 RedirectMatch ^/doc/*$ /doc/v2.12
47 # make attempt at `latest' symlink avoid ^v catch-all doc fix rule below
48 RedirectMatch ^/doc//*latest/*(.*)$ /doc/v2.13/$1
49 RedirectMatch ^/doc//*development/*(.*)$ /doc/v2.13/$1
50 RedirectMatch ^/doc//*stable/*(.*)$ /doc/v2.12/$1
51 RedirectMatch ^/doc//*([^v].*)$ /doc/v2.12/$1
52 RedirectMatch ^(/Documentation.*)$ /doc/v2.12$1
53 RedirectMatch ^/index$ /
54
55 # fix root calculation: no double slashes
56 # RedirectMatch ^(.*/)/+(.*)$ $1$2
57
58 ###########################################
59
60 ## Rewrite all non-existing files at toplevel to the /web/ dir, so our
61 ## internal structure for rsync doesn't have to be changed.
62 ## This works for the current/old site as well as the new one.
63
64 RewriteEngine on
65 RewriteBase /
66
67 SetEnvIf REQUEST_URI .* WEB=/website
68
69 # Rewrite empty to /web
70 RewriteCond %{REQUEST_URI} ^/*$
71 RewriteRule ^(/*)$ %{ENV:WEB}/ [QSA,L]
72
73 # css Request without directory part
74 RewriteCond %{REQUEST_URI} ^/?[^/]+[.]css$
75 # ...that does not match match an existing file
76 RewriteCond %{REQUEST_FILENAME} !-f
77 # ...and does not match an existing directory
78 RewriteCond %{REQUEST_FILENAME} !-d
79 # ...prefix with web
80 RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L]
81
82 # Request without trailing slash
83 RewriteCond %{REQUEST_URI} !.*/$
84 # ...that would access a directory in /web
85 RewriteCond %{DOCUMENT_ROOT}%{ENV:WEB}%{REQUEST_URI} -d
86 # ...and does not start with /web
87 RewriteCond %{REQUEST_URI} !^%{ENV:WEB}
88 RewriteCond %{REQUEST_URI} !^/website
89 # ...and does not start with /doc$
90 RewriteCond %{REQUEST_URI} !^/doc$
91 # ...add trailing slash for [menu] and to avoid /web/ in browser url
92 RewriteRule ^(.+)$ http://%{HTTP_HOST}/$1/ [R,QSA,L]
93
94 # Request that does not start with /web
95 RewriteCond %{REQUEST_URI} !^/website
96 RewriteCond %{REQUEST_URI} !^%{ENV:WEB}
97 # ...and does not start with /doc/
98 RewriteCond %{REQUEST_URI} !^/doc/
99 # ...and is not /doc$
100 RewriteCond %{REQUEST_URI} !^/doc$
101 # ...and does not match match an existing file
102 RewriteCond %{REQUEST_FILENAME} !-f
103 # ...and does not match an existing directory
104 RewriteCond %{REQUEST_FILENAME} !-d
105 # ..prefix with /web
106 RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L]
107
108 ###########################################
109
110 # latin1 version copied to web and doc/2.x
111 AddDefaultCharset utf-8
112 AddCharset utf-8 .html
113 AddCharset utf-8 .de
114 AddCharset utf-8 .en
115 AddCharset utf-8 .es
116 AddCharset utf-8 .fr
117 AddCharset utf-8 .nl
118 AddCharset utf-8 .txt
119
120 # fix broken auto language selection for Hungarian
121 AddLanguage hu .hu
122
123
124
125 # FIXME: separate this from the main "root" .htaccess material
126 DirectoryIndex index
127