I have this html saved as test
(without extension)
<!DOCTYPE html>
<html lang="en">
<head>
<base href="/">
</head>
<body>
<a href="link">link</a>
</body>
</html>
File is saved in subdirectory aa
of local root server directory so in browser it is available with http://localhost/aa/test . Base href is set to '/' as this is required by framework I use.
I'd like to define link as relative to current url (http://localhost/aa/test/link) but browser combine as relative to current directory (http://localhost/aa/link). How can I achieve this without using any scripting ? I'd like to avoid putting part of current path into href attribute.
edit
- added base href
- added doctype