Redirect Virtual Host Apache

0

I have two virtual hosts in my apache, example:

vhost.com
vhost.mx

When the user enters vhost.com he has to direct me to vhost.mx from the index.php of vhost.com

<?php header("Location: vhost.mx"); ?>

when the index.php of vhost.com is executed the URL is of the following form: www.vhost.com/www.vhost.mx and this gives me an error of URL

Do you know that you must write the two URLs?

    
asked by Ricardo Garcia 11.04.2018 в 23:12
source

1 answer

1

This is the correct syntax of the php file:

<?php header("Location:http://www.vhost.mx"); ?>
    
answered by 11.04.2018 в 23:28