html/php: how to handle absolute url's?
Posted
by YuriKolovsky
on Stack Overflow
See other posts from Stack Overflow
or by YuriKolovsky
Published on 2010-04-22T18:27:35Z
Indexed on
2010/04/22
18:33 UTC
Read the original article
Hit count: 197
Is the html tag safe to use in terms of browser support? Or should I generate a root path with PHP which i then add like this <a href="<?=BASE?>somepage.html">somepage</a>
which makes up a absolute url.
using the base tag like this <base href="<?=BASE?>" />
I am then able to use links like this
<a href="somepage.html">somepage</a>
now I am fully aware that it would be much easier to just do this without using the base tag:
<a href="/somepage.html">somepage</a>
but how do I test locally then with a base url of http://localhost/testsite/ ???
© Stack Overflow or respective owner