httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] RE: What are URLs relative to?
Date Thu, 11 Jan 2007 09:41:46 GMT
> -----Original Message-----
> From: lightbulb432 [mailto:veerukrishnan@hotmail.com] 
> Sent: Thursday, January 11, 2007 9:40 AM
> To: users@httpd.apache.org
> Subject: [users@httpd] RE: What are URLs relative to?
> 
> 
> Thanks for your response. That makes sense.
> 
> What might be the reason, then, behind the quotation from 
> that webpage in my
> original post? Why would you need to define all links 
> absolutely rather than
> relatively? If the URLs are always relative to the error page 
> URL which is
> always in the same location regardless of the requesting URL, 
> then is there
> really an advantage to relative vs absolute URLs for the reason they
> mentioned? Or am I missing something in all this?

It's a long time since I actually used an ErrorDocument directive but as
far as I am aware, apache issues a *redirect* to the error page in
response to the request for the missing URL. So the browser address
changes to the error-doc URL and then it's just as if you requested the
error-doc directly. In that case, the links in the error-doc could be
relative and the quotation would be inaccurate...

However, maybe I'm wrong - maybe apache *proxies* the error-doc... then
the browser address would not change and the relative links wouldn't
work.

Why don't you set up the experiment and report back the results - I'd be
interested to know...

Having said all that, it is always a good idea to use absolute URLs in
links because it makes the page more portable - you can move it up and
down the directory hierarchy without having to worry about changing all
the links. So I would do that anyway and then the rights and wrongs of
the original question become irrelevant.

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

> 
> Thanks.
> 
> 
> 
> Boyle Owen wrote:
> > 
> >> -----Original Message-----
> >> From: lightbulb432 [mailto:veerukrishnan@hotmail.com] 
> >> Sent: Thursday, January 11, 2007 7:36 AM
> >> To: users@httpd.apache.org
> >> Subject: [users@httpd] What are URLs relative to?
> >> 
> >> 
> >> What are relative URLs relative to? For example, if you 
> >> define an error page
> >> in .htaccess and you have relative URLs in the error page 
> >> itself (although
> >> I've heard it's better to have absolute URLs in there), are 
> >> those relative
> >> URLs resolved relative to:
> >> 
> >> a) the physical location of that error page
> >> b) the location of the requested URL (e.g. site.com/friendlyURL)
> >> c) the location of the rewritten URL (e.g.
> >> site.com/subdir1/subdir2/page.abc?hello=true)
> > 
> > Answer:
> > 
> > d) the location (ie, URL) of the error page
> > 
> > eg, if the error page is at http://server/error/404.html 
> and the link is
> > to "../index.html" then the URL of the link will be
> > http://server/index.html
> > 
> > Rgds,
> > Owen Boyle
> > Disclaimer: Any disclaimer attached to this message may be ignored. 
> > 
> >> 
> >> I saw the following from
> >> http://www.yourhtmlsource.com/sitemanagement/custom404error.ht
> >> ml, which is
> >> the reason behind this question:
> >> 
> >> "Since your 404 page might be served up from any subdirectory 
> >> of your site,
> >> make sure all links and image sources are defined absolutely. 
> >> For instance,
> >> use href="/index.html" instead of href="../../index.html""
> >> 
> >> Thanks.
> >> -- 
> >> View this message in context: 
> >> http://www.nabble.com/What-are-URLs-relative-to--tf2957180.htm
> > l#a8272516
> >> Sent from the Apache HTTP Server - Users mailing list archive 
> >> at Nabble.com.
> >> 
> >> 
> >> 
> ---------------------------------------------------------------------
> >> The official User-To-User support forum of the Apache HTTP 
> >> Server Project.
> >> See <URL:http://httpd.apache.org/userslist.html> for more info.
> >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> >> For additional commands, e-mail: users-help@httpd.apache.org
> >>
> >  
> >  
> > This message is for the named person's use only. It may contain
> > confidential, proprietary or legally privileged information. No
> > confidentiality or privilege is waived or lost by any 
> mistransmission. If
> > you receive this message in error, please notify the sender 
> urgently and
> > then immediately delete the message and any copies of it 
> from your system.
> > Please also immediately destroy any hardcopies of the 
> message. You must
> > not, directly or indirectly, use, disclose, distribute, 
> print, or copy any
> > part of this message if you are not the intended recipient. 
> The sender's
> > company reserves the right to monitor all e-mail 
> communications through
> > their networks. Any views expressed in this message are those of the
> > individual sender, except where the message states otherwise and the
> > sender is authorised to state them to be the views of the sender's
> > company.
> > 
> > 
> ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP 
> Server Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/What-are-URLs-relative-to--tf2957180.htm
l#a8273605
> Sent from the Apache HTTP Server - Users mailing list archive 
> at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP 
> Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
 
 
This message is for the named person's use only. It may contain confidential, proprietary
or legally privileged information. No confidentiality or privilege is waived or lost by any
mistransmission. If you receive this message in error, please notify the sender urgently and
then immediately delete the message and any copies of it from your system. Please also immediately
destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail communications through their
networks. Any views expressed in this message are those of the individual sender, except where
the message states otherwise and the sender is authorised to state them to be the views of
the sender's company.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message