My main page call is 'www.xxxx/!#/hear-us
'
I want to redirect the crawler to html version call hear-us.php I used
<?php
if (strpos($_SERVER['HTTP_USER_AGENT'],"Googlebot")) {
header('Location: http://xxxx/hear-us.php');
}
?>
When the url is submitted to Google web master, it does not see the redirect.
You may want to add the actual redirect code in the header you're sending either by sending the Status header before the Location one or with:
header("Location: /foo.php", TRUE, 301);
Note, this is a permanent redirect, change the code as needed.
Also, a good practice is to call exit
as soon as you send the headers, otherwise any output may modify (or garble) the message.