[Moin-user] mod_rewrite and mod_python

Robert Schumann robert at cantab.net
Thu Mar 23 02:26:06 EST 2006


Eamon Nerbonne wrote:

> You're saying that if it is a valid directory, if should NOT use the 
> rewrite rule eh?  In that case, apache will look up the default page - 
> generally index.html, though that's surely configureable too...  You 
> want to check only for valid files maybe?


D'oh! You're quite right.  I had been using those rewrite rules in a 
different context and had not even thought about the directory checking 
bit....

Thanks Eamon!

Robert.

>
> --Eamon
>
> On 3/23/06, *Robert Schumann* <robert at cantab.net 
> <mailto:robert at cantab.net>> wrote:
>
>     I've been stuggling with a small but annoying problem for a few hours.
>
>     I've set up Moin 1.5.2 on Apache 2.0.54 (Ubuntu) using mod_python and
>     mod_rewrite.  My own particular flavour of RewriteRule is slightly
>     different than that advertised on MoinMoin wiki: it checks to see if a
>     requested file really exists in the filesystem, and if it doesn't then
>     it passes the request to Moin.
>
>     It works fine, except for directories.  If someone types in
>     http://wiki.example.com/ then I would obviously like them to get
>     to the
>     FrontPage; currently, they are sent to a wiki page entitled
>     index.html.
>     Same if I try http://wiki.example.com/htdocs/modern, I just end up
>     being
>     shown a wiki page called htdocs/modern/index.html.
>
>     Does anyone know how to prevent Apache from appending index.html to
>     everything?  My apache config is shown below (including some of my
>     attempts to remove the DirectoryIndex).
>
>     Thanks for your help,
>
>     Robert.
>     --------------------------------------------------------------------------------
>
>     <VirtualHost *:80>
>             ServerName wiki.example.com <http://wiki.example.com>
>
>             # Rewrite urls
>             RewriteEngine On
>             RewriteLogLevel 2
>
>             DocumentRoot /srv/example/public_html
>             # If the request is not for a valid directory...
>             RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
>             # ...and it's not for a file...
>             RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
>             # ...then pass the path from the URL to moin
>             RewriteRule ^(.*)$ /srv/moinfiles/server/moinmodpy.py/$1
>     [last]
>             # Of course, if the user just typed http://example.com/,
>             # that needs to work too!
>             RewriteRule ^$ /srv/moinfiles/server/moinmodpy.py [last]
>
>             <Directory "/srv/moinfiles/server">
>                     AllowOverride None
>                     Options None
>                     Order allow,deny
>                     Allow from all
>
>                     AddHandler python-program .py
>                     PythonPath "['/srv/moinfiles',
>     '/srv/moinfiles/server']
>     + sys.path
>                     PythonHandler moinmodpy
>                     PythonDebug On
>             </Directory>
>
>            <Directory />
>     #               Options FollowSymLinks -Indexes
>                     Options None
>                     DirectoryIndex ""
>                    AllowOverride None
>            </Directory>
>
>     </VirtualHost>
>     ----------------------------------------------------------
>
>
>     -------------------------------------------------------
>     This SF.Net email is sponsored by xPML, a groundbreaking scripting
>     language
>     that extends applications into web and mobile media. Attend the
>     live webcast
>     and join the prime developer group breaking into this new coding
>     territory!
>     http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
>     <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>
>     _______________________________________________
>     Moin-user mailing list
>     Moin-user at lists.sourceforge.net
>     <mailto:Moin-user at lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/moin-user
>
>





More information about the Moin-user mailing list