durusmail: quixote-users: SCRIPT_NAME vs. SCRIPT_URL in get_path()
SCRIPT_NAME vs. SCRIPT_URL in get_path()
2004-09-13
2004-09-13
2004-09-14
SCRIPT_NAME vs. SCRIPT_URL in get_path()
Roman Rodyakin
2004-09-14
On Sun, Sep 12, 2004 at 10:51:59PM -0500, Martin Maney wrote:
> On Sun, Sep 12, 2004 at 10:44:18PM -0400, Roman Rodyakin wrote:
>
> [description of the rewrite problem omitted]
>
> > Looking at http_request, I see that SCRIPT_NAME is set to
> > /my/complicated/path/demo.fcgi whereas SCRIPT_URL is set to
> > /quixote/demo.fcgi/form_demo.
> >
> > Is this a bug in get_path() or is there a reason why it has to be
> > SCRIPT_NAME + PATH_INFO, and not SCRIPT_URL?
>
> [nice description of the issues involved skipped]
>
> (1) at least with Apache rewriting, I think the rewritten URL *has* to
> be valid - after all, the rwriting is explicitly of the URL: it's not a
> magical mapping from public URL to some other name space.  Though I
> suppose you could block the translated URL from public access with more
> rewriting and careful use of the "last" flag in the rules.

When I first ran into this, I plugged my RewriteRule into a long list
of RewriteRules, the last of which rewrote all URLs that reach it to
the URL space of another application server.  Thus, the substituted
URL was handled by this other application server which promptly
returned its standard Not Found page.  It may or may not be the
conceptually correct usage of the mod_rewrite features, but that's
what I had to deal with.  Of course, this is trivially fixable with
another RewriteRule (what isn't...), but as you said, this may also be
seen as a matter of decoupling the URL from its implementation.  After
all, I may one day decide to move from FCGI to SCGI, or reorganize the
directory structure under DocumentRoot, and if the physical
(rewritten) path is accessible from within my application, there may
well be links into my old physical URL space on the web.  Those links
would be invalidated by the change, even though the change wouldn't
otherwise affect the users.

That said, after reading your message I do agree that this should _not_
be classified as incorrect behavior, whether by Apache or Quixote.
Having the driver script provide the application's base access URL is
a very reasonable workaround.  Thanks a lot for taking the time to
elaborate on this.



reply