[wp-hackers] Adding a "base URI" to index.php

Carthik Sharma carthik at gmail.com
Mon Jul 26 23:09:39 UTC 2004


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>
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

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 --------



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

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

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

Carthik.






-- 
When nothing is done, nothing is left undone -- 老子 Lǎozi

University of Central Florida
Homepage: http://carthik.net



More information about the hackers mailing list