rachelwhitton
Forum Replies Created
-
Hey everyone, I help manage Pantheon’s docs and wanted to give some clarification. We recommend using PHP for redirect logic. For the original comment here, you can add the following within wp-config.php to redirect requests for sitemap.xml to sitemap_index.xml:
// 301 Redirect from /sitemap.xml to /sitemap_index.xml if (($_SERVER['REQUEST_URI'] == '/sitemap.xml') && (php_sapi_name() != "cli")) { header('HTTP/1.0 301 Moved Permanently'); header('Location: /sitemap_index.xml'); exit(); }
Sitemaps are only accessible on the live environment for sites with a custom domain.
If you’re running an older version of this plugin, that’s when you might encounter issues accessing sitemaps generated as static files. To resolve, we suggest running the lastest version of the plugin. Details on the decision to stop writing sitemaps as static files can be found in the following blog post from 2011: https://yoast.com/xml-sitemap-in-the-wordpress-seo-plugin/
Hey, thanks for the quick response!
This suggestion originates from attempting to use the plugin in distributed environments.
SERVER_NAME
returns a static value based on transient environment endpoints that will eventually expire and break.HTTP_HOST
returns dynamic URL’s based on the current request instead of relying on the temporary endpoint destinations.Also, would you be willing to include a way for users to compare results of the
$_SERVER
variable with the domain name set on the site – then run through a series of checks to match them up, and ultimately give the user the option override if nothing matched?Forum: Plugins
In reply to: [SendGrid] php short-tags to full tagsThe description of this plugin still states the following:
After installing ‘Swift Mailer’ plugin, you must have PHP-short_open_tag setting enabled in your php.ini file.
Is that still correct? If not, can the description be updated to reduce confusion? Thanks!
Forum: Plugins
In reply to: [SendGrid] php short-tags to full tagsAwesome! Thanks for the quick turnaround!
Forum: Plugins
In reply to: [SendGrid] php short-tags to full tagsThanks for the consideration. Much appreciated! Short tags are not supported on every server.