I have an AWS load balancer that does a 301 redirect from URL test1 to URL test2. For the most part the redirect works as expected, however, when I have a script with type=module, then test1 isn't redirected to test2. Is this by design, and is there any way to get it properly redirected?
script type=module src=https://test1....
relativeurl in your webpage thanabsolute. Example for relative:src="/scripts/script.js"and for absolute issrc="https://example.com/scripts/script.js". In the code section you are using, change it toscript type=module src=/<url path to script>. The same applies for CSS files as wellrelativewill help. When the initial index page is requested, it will be getting redirected to "test2". Browser will then go to "test2" to get the index page which is where theJSandCSSfiles are mentioned. If you are usingrelativeoption, browser will consider the domain for the full url of the file astest2. This way, the request for the script file will be directly going totest2.Absoluteoption usually used when you are required to fetch content from a different domain which is not your case.