Jump to content

Archived

This topic is now archived and is closed to further replies.

raduenea

meaning of base tag

Recommended Posts

Hi,

 

Can you please tell me in witch conditions should be used base tag.

 

If have a website that base tag it's define in header like:  <base href="http://www.website.com/">

What's the meaning of this ?

 

Thank you

Share this post


Link to post
Share on other sites

It will change to what url will point relative urls in your document. F.E when your domain is www.example.com, this relative path

<a href="test">Test relative link</a>

will point to www.example.com/test. But if you will change base to f.e this one

<base href="http://www.new_example.com/">

"Test relative link" will point to www.new_example.com/test

Share this post


Link to post
Share on other sites

Can be used as an absolute pah inside in php script for all folders (images, admin, etc) ?

Or is another better solution. 

Share this post


Link to post
Share on other sites

If you are echoing PHP values to html and you need to rewrite all relative links then yes, this is probably best method. Otherwise use simple string merging and echo values with var like $newURL. before them

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.