As your website is in maintenance mode then other codes will not work. If you check the index.php file in your magento root folder then you can find that magento will not run further when they find maintenance file in your root directory.
You can solve this by creating a custom php file in your magento root and include the Mage.php after that you can use the magento functions according to your requirement.
METHOD 2 You
You will get route name for the pages you want to consider by following code:
$routename = Mage::app()->getRequest()->getRouteName();
After that you need to put the condition like below:
if (file_exists($maintenanceFile) && $routename != 'YOUR_ROUTE_NAME') {
include_once dirname(__FILE__) . '/errors/503.php';
exit;
}
You can get your routename(YOUR_ROUTE_NAME) by echo $routenameecho $routename
just above the below code:
if (file_exists($maintenanceFile) && $routename != 'YOUR_ROUTE_NAME')
METHOD 3:
If Method 2 was not working, then try:
$routename = parse_url($_SERVER['REQUEST_URI']);
if (file_exists($maintenanceFile) && $routename['path'] !== "/newsletter/subscriber/new/") { ... }
You can get your routename(YOUR_ROUTE_NAME) by echo $routename['path']
just above the below code:
if (file_exists($maintenanceFile) && $routename['path'] != 'YOUR_ROUTE_NAME')