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

Amit Gupta amit at igeek.info
Mon Jul 26 22:55:26 UTC 2004


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
<mailto: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.

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


More information about the hackers mailing list