Alternative hostname
-
Hi! Our configuration is a little complex and we are abusing the subdirectory feature to actually move our sitemaps UP a directory (our front-end proxies only pass through known urls, not dynamic urls).
So this results in /sitemap/sitemap-pt-post-2017-03.xml being reverse proxied to the proper URL (/sitemap-pt-post-2017-03.xml) on an internal server that is not blocked by the front-end proxies. Crazy, I know. I can explain more deeply in a private conversation.
The problem we now have is that the sitemap is generated with the proxied hostname, not the actual hostname we want google to find. To fix this we added this to the top of the AddUrl function in sitemap-core.php. Its a simple and innocuous change that only takes effect if someone defines the constants.
if(defined(‘XML_SITEMAP_OVERRIDE_URL’) && defined(‘XML_SITEMAP_OVERRIDE_ORIGINAL_URL’) ){
$loc = str_replace(XML_SITEMAP_OVERRIDE_ORIGINAL_URL,XML_SITEMAP_OVERRIDE_URL,$loc);
}What this does for us is allow us to override the proxied url with the actual URL so google is indexing the correct sites.
Its an odd use case but I was wondering if I could beg/pay you to add this function to the core so that we can get on the normal update cycle?
Happy to discuss 1-to-1. Seriously, we’ll pay you to add this. Its that critical for our workflow.
Let me know! Tx!
- The topic ‘Alternative hostname’ is closed to new replies.