URL redirection as in LoopiaDNS

This article explains how the URL redirection (HTTP 301/302 redirect) feature in LoopiaDNS works, and how to reproduce the same behaviour yourself using a PHP script. The URL redirection (WWW redirection) feature that you can enable in the LoopiaDNS service is most easily compared to a PHP script that uses the header() function to change the address that the browser displays.

Replicating the redirection with your own PHP file

The equivalent PHP code that we use is appended to this document. You only need to replace https://www.loopia.se/closed/ with the address you want to use instead.

Right-click on this link and select Save As index.php to save the file to disk, then upload it to your public_html/ folder.

Address bar behaviour

Unlike URL forwarding (frame-based), URL redirection sends the visitor’s browser an HTTP redirect, so the address bar updates to the destination URL.

Was this article helpful?

Related Articles