Am Donnerstag, 12. November 2009 21:47:45 schrieb Graham Percival: > Anybody want to save me a half an hour of maintenance, and a few > hours of sanity? Look this up. > (alternately, if you already know apache, just answer the question) [..] > > Can't we have the directory structure internally with /web/ , > > /download/ what have you, and use some serverside URL rewriting to > > make translate > > > > /foo/ > > > > into > > > > /web/foo/ > > > > ? Does apache have mechanisms for rewriting the serving path without > > rewriting the URL that appears in browser window?
Yes, of course. Just use the mod_rewrite module (if its not already enabled, run "a2enmod rewrite"). In the .htaccess file in the server's base web directory (i.e. the dir that contains web/), simply add: ########################################### ## Rewrite all non-existing files at toplevel to the /web/ dir, so our ## internal structure for rsync doesn't have to be changed. RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /web/$1 [QSA,L] ########################################### Explanation: First, turn on the rewriting engine and tell it that it is rewriting at the web server root (I'm not sure whether the RewriteBase is needed at all). Then we check, if a file (-f) or a dir (-d) with the requested name exists. Or rather, we check that none of them exist (the ! negation) and only in that case, rewrite all requests from /foo/ to use /web/foo/ internally instead. Cheers, Reinhold -- ------------------------------------------------------------------ Reinhold Kainhofer, reinh...@kainhofer.com, http://reinhold.kainhofer.com/ * Financial & Actuarial Math., Vienna Univ. of Technology, Austria * http://www.fam.tuwien.ac.at/, DVR: 0005886 * LilyPond, Music typesetting, http://www.lilypond.org _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user