Blog

22 de June de 2023

Redirection to another website

Redirecionamento para outro site

If you have an old website, and you want to put the accesses from this website to a new one, a redirect must be made. Redirection will make this transfer in navigation automatically, using the URL.

It is recommended to do this directly on the server, but if you prefer, it can be done with the files index.php and the .htaccess. For that, let's do the following:

Step by step

Time needed: 5 minutes

  1. Open the index.php file with an HTML editor.

    I particularly like Sublime Text.

  2. Place in index.php the link to where it will be redirected.

    Remember that there is a difference between “http” and “https”.

    <?php header('Location: https://paginadedestino.php'); ?>

  3. Pass everything to the server via FTP.

    Leave only the two files, remembering to make a general backup of the site.

The .htaccess it's important, it will cause every link typer in the address bar to drop in index.php.

Share:

Download

Others

Tips

$_SESSION

$_SESSION

View more

Pulsar

Pulse

View more

Pseudo-Elementos

Pseudo-Elements

View more