Re: VirtualHost, ScriptAlias, AddHandler, and relative URLs..

"Roger Mayes" <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
>> If the page returned when http://my.host.com/moduleA is requested
asks for
>> css/mystyles.css, the request uri is /css/mystyles.css.  (It puts in
a
>> leading slash whether url the page asked for has one or not.)  The
thing is,
>> I want to map /css/mystyles.css to /myhost/htdocs/css/mystles, not to
>> /myhost/moduleA/htdocs/css/styles.  But I want to map
>> css/mystles.css to the later.  But I have no way to tell which of the
two
>> was requested.

>An http client only sends the absolute form of the path, obviously
>assembled via the context in which the href appears.

>You'd need to change one of the URIs to differentiate between the two.

So, in other words, from the page that resulted from a request for
'/foo', a reference to 'bar' gets sent to the server as a request for
'/foo/bar'. So since I'm alias'ing '/', there's no way to differentiate
between 'bar' and '/bar'?  I should be able to, because a request for
'bar' should get sent as '/foo/bar', not as '/bar'. Wrong?

I'm returning a page in response to a request for
'http://my.host.com/mymodule'.  That page requests 'css/mystyles.css'.
So I should get a request for
'http://my.host.com/mymodule/css/mystyles.css'.  But I'm not: I'm
getting a request for 'http://my.host.com/css/mystyles.css'.  Why is
that?

More specifically, the first request_uri comes in as '/mymodule'. The
second request_uri should be for '/mymodule/css/mystyles.css', right?
But it's not. It's showing up as '/css/mystyles.css'. What's going on?
Is it some weird config issue?  Something to do with ScriptAlias?

I notice that this only happens when I ScriptAlias /.  If I ScriptAlias
/script, or something else instead, then I get request_uri's more like I
expect.  But I don't want my users to have to put '/script' in their..
URLs.. hmmm.. I wonder if I could fix it by rewriting ^/* to /script$1,
then ScriptAlias'ing /script. But then I have kind of a weird config
requirement. (On the other hand, web server configuration is a pretty
black art anyway.)

Any idea why I'm getting a request_uri of '/css/mystyles.css' instead of
'/mymodule/css/mystyles.css'?  When requesting 'css/mystyles.css' from
'/mymodule'?


Here's another question for you. Apache sets request_uri so that it
contains the part of the uri that comes after the scheme and the host,
but before the query string. Is that standard across servers, or..? Do
other servers even implement request_uri? 


___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.