I'm using this html code to redirect to another URL when the page (www.dasinfobuch.de/links/Wizz) is invoked:
<head>
<meta http-equiv="refresh" content="0; URL=http://52.28.104.181:8080/Wizard/Wizz">
</head>
However, when I use a URL parameter such as
www.dasinfobuch.de/links/Wizz?template=test
the parameter is not passed on to the redirected page. Is there a way to accomplish this (preferably in plain HTML)? (I'm new to Web programming.)
To redirect to another page in JavaScript, you can use window. location. href property, window. location will also work and if you want you can use window.
You can use URL Redirect to forward your visitors to a specific page at the destination URL and pass values via query strings to the destination.
To add a parameter to the URL, add a /#/? to the end, followed by the parameter name, an equal sign (=), and the value of the parameter. You can add multiple parameters by including an ampersand (&) between each one.
Click the URL Redirects tab. In the upper right, click Add URL redirect. In the right panel, select the Standard or Flexible redirect type. A standard redirect is used to redirect one URL to another.
This is not possible using only a meta element that mimics the non-standard Refresh
HTTP header field. Of course there are other ways.
If you’ve got something like a preprocessor, you can pass on the request to the HTML, like so:
<meta http-equiv="refresh"
content="0; URL=http://52.28.104.181:8080/Wizard/Wizz?template=<%
out.print(request.getParameter("template")) %>">
Another (client-side) way is to redirect using JavaScript:
document.location.href = 'http://52.28.104.181:8080/Wizard/Wizz' + document.location.search;
Note that this will carry over the entire query string, not just the template
parameter and its argument. If that’s a problem, it’s easy to get only the desired string from location.search
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With