X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fweb%2Fserver%2Flilypond.org.htaccess;fp=Documentation%2Fweb%2Fserver%2Flilypond.org.htaccess;h=d696f1093ed1f305bbb4401762383b0c928780c9;hb=941dff9d2a67080e0dd8474f1e70f0c72ace6424;hp=0000000000000000000000000000000000000000;hpb=5a22d6233a39d3164e1ca043244794c268be4ad0;p=lilypond.git diff --git a/Documentation/web/server/lilypond.org.htaccess b/Documentation/web/server/lilypond.org.htaccess new file mode 100644 index 0000000000..d696f1093e --- /dev/null +++ b/Documentation/web/server/lilypond.org.htaccess @@ -0,0 +1,127 @@ +# htaccess for root dir of lilypond.org +# ---------------------------------------------------- +# The file comes from git master: +# Documentation/web/server/lilypond.org.htaccess +# +# Please do not edit it directly (unless something +# is critically broken); instead, change it in git +# and then do the: +# update-git.sh +# check-git.sh +# copy-git.sh +# make-website.sh +# as discussed in: +# Contributor 5.2 Uploading and security +# ---------------------------------------------------- + +RewriteEngine On + +# Deny following of symlinks by robots. +# HTTrack is a known offender. +# better yet, to redirect this to page that tells adminstrator +# about brokenness +RewriteCond %{HTTP_USER_AGENT} httrack [NC] +RewriteRule ^.*/source/.*$ /please-respect-robots.txt.html [L] + +# Permanent top level entry points -- ./doc +RedirectMatch ^/music-glossary /glossary +RedirectMatch ^/tutorial /learning +RedirectMatch ^/documentation/$ /doc +# Possibly resurrect this with new web site +# This breaks the documentation index with old site +# RedirectMatch ^/documentation$ /doc +# +RedirectMatch ^/bugs /bug-reports +#RedirectMatch ^/bugs http://code.google.com/p/lilypond/issues/list +RedirectMatch ^/wiki http://wiki.lilynet.net +# the new website already has an /authors +#RedirectMatch ^/authors /doc/Documentation/topdocs/AUTHORS +# the new website has news on the main page +RedirectMatch ^/news / +RedirectMatch ^/stable /doc/stable +# the new website has a dedicated page for development. +#RedirectMatch ^/development /doc/development + +#old# default doc dir +RedirectMatch ^/doc/*$ /doc/v2.14 +# make attempt at `latest' symlink avoid ^v catch-all doc fix rule below +RedirectMatch ^/doc//*latest/*(.*)$ /doc/v2.15/$1 +RedirectMatch ^/doc//*development/*(.*)$ /doc/v2.15/$1 +RedirectMatch ^/doc//*stable/*(.*)$ /doc/v2.14/$1 +RedirectMatch ^/doc//*([^v].*)$ /doc/v2.14/$1 +RedirectMatch ^(/Documentation.*)$ /doc/v2.14$1 +RedirectMatch ^/index$ / + +# fix root calculation: no double slashes +# RedirectMatch ^(.*/)/+(.*)$ $1$2 + +########################################### + +## Rewrite all non-existing files at toplevel to the /web/ dir, so our +## internal structure for rsync doesn't have to be changed. +## This works for the current/old site as well as the new one. + +RewriteEngine on +RewriteBase / + +SetEnvIf REQUEST_URI .* WEB=/website + +# Rewrite empty to /web +RewriteCond %{REQUEST_URI} ^/*$ +RewriteRule ^(/*)$ %{ENV:WEB}/ [QSA,L] + +# css Request without directory part +RewriteCond %{REQUEST_URI} ^/?[^/]+[.]css$ +# ...that does not match match an existing file +RewriteCond %{REQUEST_FILENAME} !-f +# ...and does not match an existing directory +RewriteCond %{REQUEST_FILENAME} !-d +# ...prefix with web +RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L] + +# Request without trailing slash +RewriteCond %{REQUEST_URI} !.*/$ +# ...that would access a directory in /web +RewriteCond %{DOCUMENT_ROOT}%{ENV:WEB}%{REQUEST_URI} -d +# ...and does not start with /web +RewriteCond %{REQUEST_URI} !^%{ENV:WEB} +RewriteCond %{REQUEST_URI} !^/website +# ...and does not start with /doc$ +RewriteCond %{REQUEST_URI} !^/doc$ +# ...add trailing slash for [menu] and to avoid /web/ in browser url +RewriteRule ^(.+)$ http://%{HTTP_HOST}/$1/ [R,QSA,L] + +# Request that does not start with /web +RewriteCond %{REQUEST_URI} !^/website +RewriteCond %{REQUEST_URI} !^%{ENV:WEB} +# ...and does not start with /doc/ +RewriteCond %{REQUEST_URI} !^/doc/ +# ...and is not /doc$ +RewriteCond %{REQUEST_URI} !^/doc$ +# ...and does not match match an existing file +RewriteCond %{REQUEST_FILENAME} !-f +# ...and does not match an existing directory +RewriteCond %{REQUEST_FILENAME} !-d +# ..prefix with /web +RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L] + +########################################### + +# latin1 version copied to web and doc/2.x +AddDefaultCharset utf-8 +AddCharset utf-8 .html +AddCharset utf-8 .de +AddCharset utf-8 .en +AddCharset utf-8 .es +AddCharset utf-8 .fr +AddCharset utf-8 .nl +AddCharset utf-8 .txt + +# fix broken auto language selection for Hungarian +AddLanguage hu .hu + + + +# FIXME: separate this from the main "root" .htaccess material +DirectoryIndex index +