Hello,

In my htdocs/ I have two folders: folder1 & folder2:

I am trying to redirect :

folder1/index.php ------> www.contoh1.com

folder2/index2.php -------> www.contoh2.com

how to code it?

Someone told me to utilize this: http://php.net/manual/en/reserved.variables.server.php

but how to code it?

I mean not "redirect" but associating index1.php ---> to www.contoh1.com domain

index2.php ---> to www.contoh2.com

how?

Here is part of the revise code:

How to make it right?

index.php

<?php

 if(!empty($_SERVER['REQUEST_URI']) && !empty($_SERVER['HTTP_HOST']))
    {
       $uri = 'http://www.edu-one.co.id';           
       $uri .= $_SERVER['HTTP_HOST'];

    if ($uri == 'http://www.squprime.com') { 
       header('Location: .$uri./squprime/');
    } elseif  {
    header('Location: .$uri./portal_bootstrap/');
    }

    }
?>  
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.