This website uses necessary cookies to ensure that our website is ideally usable. We do not use cookies that process personal data without your prior consent. Read our Cookie Policy

book reader icon
1 Minute
facebook logo gray
linkedin logo gray
mail logo gray

What is the difference between a 301 and JavaScript redirection?

In your account settings you can choose if the user will be redirected with a 301-redirect or through JavaScript when scanning a QR Code. So what is the difference?

A 301-redirect calls the target page directly whereas a JavaScript redirect loads a page first where JavaScript code is executed to redirect to the target page.

301-redirect

A 301-redirect tells the browser to immediately go to the target website. When you scan a QR Code the Shorted URL in the code will be requested by the browser. The browser receives an instruction by our server to go to directly to the target page in the header of the response e.g.

Status 301 Moved Permanently
location: https://www.yourwebsite.com

JavaScript Redirect

When you select to redirect with JavaScript an intermediate blank website is loaded first in the browser. On this page cookies are set, scripts for re-targeting are loaded or the GPS location may be retrieved before redirecting the user to the target website. Then the target page is loaded via a JavaScript instruction e.g.

<script>window.location='https://www.yourwebsite.com';</script>
Last update 3 months ago