[wp-hackers] Adding a

Amit Gupta amit at igeek.info
Mon Jul 26 23:29:09 UTC 2004


there is no need to use the physical path at all. If you put a "/" at
the beginning of a path, the server takes it as relative to root, so you
don't have to give the full physical path. It works on both Windows &
Linux, I dunno about others. :)
just for example, go to a post on my blog at
http://blog.igeek.info/still-fresh/2004/07/26/bingo-sporting-12-finally/
, so you are virtually in a sub-sub-sub dir of root. now if you notice
the XML images in the left menu, just view the source of the page &
search for the text "xml.gif" You'll see that the path is given like
"/wp-images/xml.gif" & its taking it fine as the wp-images dir is in the
root & its refering to the correct file. But if I remove the "/" from
the beginning of the path, it'll take it as
"/still-fresh/2004/07/26/wp-images/xml.gif" which obviously isn't there
& hence won't display the images.

--
Amit




-------- Original Message from carthik at gmail.com
<mailto:carthik at gmail.com>  --------

then the user would have to use /public_html/blog/example/foo.jpg for
example, which is an absolute path.
I was talking about links relative to index.php


----- Original Message -----
From: Amit Gupta < amit at igeek.info
<http://us.f129.mail.yahoo.com/ym/Compose?To=amit@igeek.info&YY=44285&or
der=down&sort=date&pos=0&view=a&head=b> >
Date: Tue, 27 Jul 2004 04:25:26 +0530
Subject: Re: [wp-hackers] Adding a "base URI" to index.php
To: hackers at wordpress.org
<http://us.f129.mail.yahoo.com/ym/Compose?To=hackers@wordpress.org&YY=44
285&order=down&sort=date&pos=0&view=a&head=b> 

That's a cool little fix to most users problems which they face when
using permalinks. But using that means, all URLs should be relative to
root. So why not use URLs relative to root earlier too?
I mean that if the <base> tag is used, then to refer a file in 
cd sub-dir of 
ab dir, you'll have to use

ab/cd/file.php

if the <base> tag is not used, then also this can be done, like

/ab/cd/file.php

So that means that its upto the user using it, rather than anyone
else. I mean that if you address your files like the way above, you'll
never get problems when using permalinks. So why use the <base> tag
when a "/" at the beginning of the url can do the same thing.

Just wondering!!


--
Amit




-------- Original Message from carthik at gmail.com
<http://us.f129.mail.yahoo.com/ym/Compose?To=carthik@gmail.com&YY=44285&
order=down&sort=date&pos=0&view=a&head=b>  --------



I came across this thread in the support forums, which helps avoid
problem with users adding relative links to images and such (even the
stylesheet link wp uses is _not_ relative),and I think this is a
common enough problem, because the relative link would break when
using permalinks. The thread I am talking about is at
http://wordpress.org/support/3/9261
<http://wordpress.org/support/3/9261> 

The solution is a w3.org recommendation(
http://www.w3.org/TR/REC-html40/struct/links.html#h-12.4
<http://www.w3.org/TR/REC-html40/struct/links.html#h-12.4>  ) to add
<base href=" http://www.youwebsite.com/ <http://www.youwebsite.com/> ">
to index.php

This might be a useful modification to the default index.php, and more
user friendly.

Carthik.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/hackers_wordpress.org/attachments/20040727/dede520c/attachment.htm


More information about the hackers mailing list