Is there a way to set window.location so that relative paths follow this instead of what is given by default window.location

StackOverflow https://stackoverflow.com/questions/23626155

  •  21-07-2023
  •  | 
  •  

Question

I have a new server and I have existing files with relative links in CSS, img tags, etc. How do i set my own window.location to be followed by such files, I am not looking for anything hectic in particular just for within my website. e.g http://stackoverflow.com and https://stackoverflow.com/questions/ I need the latter to be my site-url. I am thinking in the lines of javascript but any solution is welcome.

Was it helpful?

Solution

Maybe you will be able to use the <base>-tag

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

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top