Use the <base> element . It allows you to specify a URL for all relative URLs on the page.
for instance
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>This is an example for the <base> element</title> <base href="http://www.example.com/news/index.html"> </head> <body> <p>Visit the <a href="archives.html">archives</a>.</p> </body> </html>
The link in this example will be a link to " http://www.example.com/news/archives.html .
For you, the base URL can be as simple as <base href="http://www.yoursite.com/"> . This would make images defined as src="image.png" , as "http://www.yoursite.com/image.png"
See also https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
source share