0

My goal here is that I am making a web proxy, and for rewriting HTML, I will need a <base> for the assets to fetch off. The problem is that I can't find anyway to have exceptions for <base> which I need for srcs and hrefs beginning with ./ or not / . If its not possible to do this with <base>, then is there Javascript that works and behaves exactly like <base>. I would also need to create another <base> for srcs and hrefs that start with ./ or don't start with /

If I am not being clear enough then please explain in comments. I am not sure what code to put here since I am talking about a tag.

jasoncornwall
  • 189
  • 1
  • 7

1 Answers1

0

The problem is that I can't find anyway to have exceptions for which I need for srcs and hrefs beginning with ./ or not / .

Why you can't use ./ or / ? You are absolutely allowed to use.

See the note on docs about href attribute:

The base URL to be used throughout the document for relative URLs. Absolute and relative URLs are allowed.

For further details, you may be interested to look into other post about absolute and relative links.

Bhojendra Rauniyar
  • 83,432
  • 35
  • 168
  • 231