Html <base> not working with href on localhost
My links look like
<link rel="stylesheet" href="/utils/style.css" />
I had my site in the main directory, so this is not a problem, but when I moved all my files to / dir / I, create the base tag:
<base href="http://localhost/dir" />
But that will not work. It works fine though, if I use the online address on my website
<base href="http://www.my-website.com" />
what's wrong?
Pawel, " , URL- ...": , : URL: s , URL: s , , , . , ( ) , href base. ( .)
. . , URL-, <a href> <img src> .., (.. ) : mytoplevel-dir/mysubdir/myresource.xxx , , : myresource.xxx, , () (../subdir ../myresource.xxx). , URL: s , href base .
, , -): PHP base. $_SERVER["SCRIPT_NAME"] (.. , ). ( ). :
<?php require_once('../common/php/URL_Manager.php'); ?>
.
.
<base href="<?php echo URL_Manager::getCurrentServerAndContextPath(); ?>" />
.
., <base href> , / ( ), , . <a href>, <img src> <link href> ( , ).
<base href> , , , - , . <base href> p >
<base href> , , , <base href>, - , .
, .
, , , , base, , , , , :
<a href="<?php echo URL_Manager::getCurrentPath(); ?>#menuBookmark">
:
<a href="#menuBookmark">