[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /usr/doc transition and other things

On Sep 02, Anthony Towns wrote:
> AFAIK, it's just not possible to make Apache (and other web browsers)
> make both /usr/doc and /usr/share/doc accessible at the one
> http://localhost/doc URL.

Yes, it is, using mod_rewrite.  Something like:

RewriteEngine on

RewriteCond /usr/doc/$1 -F
RewriteRule ^/doc/(.*) /usr/doc/$1 [L]
RewriteRule ^/doc/(.*) /usr/share/doc/$1

If /usr/doc/(URL) exists, we look there, otherwise we use
/usr/share/doc/(URL) (and if that doesn't exist, we bomb with a 404
Not found)

I may have the RewriteCond flag wrong... oh well, look at the
mod_rewrite docs if it doesn't work :-).

[Cc'd to Apache maintainer]

|         Chris Lawrence        |      Get the skinny at DeltaPolitics      |
|    <quango@watervalley.net>   |       http://deltapolitics.dhs.org/       |
|                               |                                           |
|    Grad Student, Pol. Sci.    |    Join the party that opposed the CDA    |
|   University of Mississippi   |             http://www.lp.org/            |

Reply to: