Skip to content

Instantly share code, notes, and snippets.

@molotovbliss
Created March 10, 2016 19:28
Show Gist options
  • Save molotovbliss/f398c0ac9168da20cf4d to your computer and use it in GitHub Desktop.
Save molotovbliss/f398c0ac9168da20cf4d to your computer and use it in GitHub Desktop.
Bypass Maintenance Mode in Magento with custom HTTP_USER_AGENT
Overwrite the maintenance change in index.php file conditional with the follow, using a more unique User Agent is recommended.
Chrome/Firefox/etc. most browsers offer means via extensions or development tools to set a customer User Agent. Utliziing this
you can bypass the maintance mode for Testing when you don't have a Static IP:
# If user agent is "QA" bypass maintenance mode (customize user agent for more uniqueness)
if (file_exists($maintenanceFile) && $_SERVER['HTTP_USER_AGENT'] != "QA") {
include_once dirname(__FILE__) . '/errors/503.php';
exit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment