I wish to redirect some pages on my domain to 2nd domain, but only for Opera.
I can do this to the following.
<?php
if (strstr($_SERVER['HTTP_USER_AGENT'], "Opera")) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: [
domainname.com...]
exit;
}
else {
header('Content-Type: text/html; charset=ISO-8859-1');
};
?>
But would prefer to redirect to the same url on the other domain.
I can;t make an htaccess rule, as there are too many pages i wish to exclude from the rule, this bit of php being inserted as necessary into the affected pages.
How do a modify this to transfer to the matching url, rather than the root of the 2nd domain?