Created
December 12, 2013 23:45
-
-
Save RickyPughcardo/7937651 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Redirect to force indexing with custom domain sitemap | |
$subject = $_SERVER['HTTP_HOST']; | |
$pattern = '/gotpantheon.com/sitemap.xml$/'; | |
preg_match($pattern, $subject, $matches); | |
$counted = count($matches); | |
if ($counted > 0 ) { | |
header('HTTP/1.0 301 Moved Permanently'); | |
header('Location: http://yoursite.com/sitemap.xml'. $_SERVER['REQUEST_URI']); | |
exit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment