1
how to make one page redirect to another using URL parameters
for example: www.dominioaqui.com.br/index.html? link=https://www.google.com
in this example I have a page with a button that redirects to the parameter inserted in "? link=" that would be Google.
this way I can use the same page with several parameters, without having to create a different page for each link
a code I found but tried to use and it didn’t work
Carry on<script>
var path = location.pathname+location.search;
var meusiteid = 'https://www.meusite.com.br' + path;
document.getElementById('linknaurl').addEventListener('click', function (e) {window.location.replace(meusiteid);});
</script>
Thank you very much! it worked.
– Lucas Queiroz