Skip to content

Commit

Permalink
Add corresponding relationship between PC page and phone page in site…
Browse files Browse the repository at this point in the history
…map for Google Search Engine. #41: Fixed bug.
  • Loading branch information
lincanbin committed Apr 25, 2015
1 parent 8c75154 commit b62871d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
$IsGoogleBot = preg_match('/(googlebot|mediapartners-google|adsbot-google)/i', $UserAgent);
$IsBaiduBot = preg_match('/(baiduspider)/i', $UserAgent);
}
$XMLNameSpace = '';
if($IsGoogleBot){
$XMLNameSpace = ' xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0"';
}elseif ($IsBaiduBot) {
Expand All @@ -25,6 +26,7 @@
ob_start();
?><?xml version="1.0" encoding="UTF-8" ?>
<?php
$MobileTag = '';
if($_SERVER['HTTP_HOST'] == $Config['MobileDomainName'])
{
if($IsGoogleBot){
Expand Down

0 comments on commit b62871d

Please sign in to comment.