0

i want to redirect a domain to another domain but without change the URL.

For Example:

ADomain.com redirect to BDomain.com/xxx/xxx/xxx/?xxx=xxxx

i was tried some htaccess

RewriteCond %{HTTP_HOST} ^(www\.)?ADomain\.com$ [NC]
RewriteRule ^(.*)$ http://BDomain.com/xxx/xxx/xxx/?xxx=xxx [R,L,NC]

This code was redirect perfectly . But it's change the current browser url (ADomain.com) to the original link (BDomain.com/xxx/xxx/xxx/?xxx=xxxx). but i don't need it. i just want to keep the url ADomain.com. please guide me any one. thanks advance

1 Answers1

0

Add this PHP code into index.php

<?php

function dwn_prt($url,$user_agent='Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)') 
{ 
$ch = curl_init(); 
curl_setopt ($ch, CURLOPT_URL, $url); 
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent); 
curl_setopt ($ch, CURLOPT_HEADER, 0); 
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt ($ch, CURLOPT_REFERER, 'http://ADomain.com');
$result = curl_exec ($ch); 
curl_close ($ch); 
return $result; 
}
  echo dwn_prt('http://BDomain.com/xxx/xxx/xxx/?xxx=xxxx');
?>