and, I figured it out.  Wanted to post what I came up with, both for
comment, and for anyone else who runs into it.  If i've done something
wrong or just plain silly here, feel free to let me know, I'm all for
another, better solution, but at the moment this seems to have worked.

my .htaccess file now looks like this:

#################################################

AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} dispatch.fcgi
RewriteRule ^(.*)$ - [L,PT]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^$ /dispatch.fcgi/ [L,PT]
RewriteRule ^(.*)$ /dispatch.fcgi/$1 [L,PT]

#################################################

And I did this in lib/base.py, in __before__:

#################################################
<code>
def __before__(self):
    env = {}
    for k,v in request.environ.items():
        env[k] = v
    # should import routes somewhere above
    config = routes.request_config()
    new_env = r_conf.environ
    new_env['SCRIPT_NAME'] = ''
    new_env['SCRIPT_FILENAME'] = ''
    new_env.update(env)
    r_conf.environ = new_env
</code>
#################################################

this has made it so that mod_rewrite, fcgi, and pylons all work for me
at nice clean / 'root' urls.

Pete

On Dec 14, 7:26 pm, baldtrol <[EMAIL PROTECTED]> wrote:
> Hi again,
>
> I'm still stuck here, and haven't been able to find anything else that
> clears it up.  I've read everything I can find, and rewritten my
> mod_rewrite rules and conditions repeatedly, and while they work just
> as I would expect, the URLs don't work correctly, inasmuch as the
> pylons application does not respond to root urls like /login, etc.
> the homepage will show up correctly, so / is being correctly rewritten
> by the rules and served by pylons, but no other url works.  It simply
> redirects itself circularly, trying to find /dispatch.fcgi/.  I've
> added rewrite conditions that check to see if the file exists, in
> order to try to forestall this redirection, but it doesn't seem to
> work.
>
> I'm sorry to functionally repost the same question, but I've tried to
> follow the instructions on pylonshq as closely as possible, and I
> can't figure out what's going wrong.  If anyone has a working solution
> that I could look over, that would be excellent.  It doesn't seem to
> be a problem with fcgi, or flup, as both of them do return content,
> just not at the correct root urls.  it does display content if I
> browse the url's at /dispatch.fcgi/login et al.
>
> Thanks again,
> Pete
>
> On Dec 13, 10:27 am, "Pete Taylor" <[EMAIL PROTECTED]> wrote:
>
> > Hi all...  I've searched through the pylons discuss archives, and am
> > still a bit stuck.
>
> > I've read through the deployment guide for
> > pylons/apache/fcgi/mod_rewrite at pylonshq, as well as most of the
> > documents linked from it in reference.  I'm pretty used to deploying
> > rails
> > applications in similar ways, so most of it was familiar...  But I've
> > run into a snag that I'm hoping you might be able to help me pin down.
> >  I saw a few references to what seems to be a similar issue on the
> > lists.  Since the pylonshq guide to deployment seems to be out of date
> > as of .8, it may just be something I'm missing?
>
> > I'm using flup, and the application works, other than some
> > unfortunately hard-coded absolute paths to images, behind
> > dispatch.fcgi.  However, when I put in the override for SCRIPT_NAME =
> > '' in config.environ, and make my .htaccess rewrite rules match those
> > on the write up (which are pretty close to the ones rails uses as
> > well), I sit in an infinite (up to 10, of course, at which point
> > apache kills it anyway) redirection loop, where dispatch.fcgi keeps
> > getting post-pended to the redirect url, making it look like
> > /dispatch.fcgi/dispatch.fcgi/ (etc) in the rewrite.log.
>
> > My current rewrite rules look like this:
>
> > RewriteEngine On
> > RewriteRule   ^$  /dispatch.fcgi/
> > RewriteRule   ^(\[-_a-zA-Z0-9/\.]+)$  /dispatch.fcgi/$1
>
> > I've tried a number of permutations of the modifications to
> > lib/base.py as described in the "Fixing Broken Routes" part of the
> > document (overriding SCRIPT_NAME in config.environ), but I can't seem
> > to make it play nicely with mod_rewrite.
>
> > I'm using Pylons 0.9.5, apache2.2, on ubuntu.  Any help would be great.  
> > Thanks!
>
> > Pete

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to