TWPU Posted May 5, 2016 Share Posted May 5, 2016 Hi Guys I would like to redirect customers to my other website while my new site is under construction. How do I add an url to my other site on the page that show Under maintenance? Link to comment Share on other sites More sharing options...
Rolige Posted May 5, 2016 Share Posted May 5, 2016 You can add a simple redirection in the file: /classes/controller/FrontController.php Search for a code similar to this: /* Display a maintenance page if shop is closed */ protected function displayMaintenancePage() { if ($this->maintenance == true || !(int)Configuration::get('PS_SHOP_ENABLE')) { $this->maintenance = true; if (!in_array(Tools::getRemoteAddr(), explode(',', Configuration::get('PS_MAINTENANCE_IP')))) { header('HTTP/1.1 503 temporarily overloaded'); And add: Tools::redirect('https://www.google.com/'); After the line: header('HTTP/1.1 503 temporarily overloaded'); Final code should looks like this: /* Display a maintenance page if shop is closed */ protected function displayMaintenancePage() { if ($this->maintenance == true || !(int)Configuration::get('PS_SHOP_ENABLE')) { $this->maintenance = true; if (!in_array(Tools::getRemoteAddr(), explode(',', Configuration::get('PS_MAINTENANCE_IP')))) { header('HTTP/1.1 503 temporarily overloaded'); Tools::redirect('https://www.google.com/'); Of course you need change the URL 1 Link to comment Share on other sites More sharing options...
TWPU Posted May 6, 2016 Author Share Posted May 6, 2016 Thank You. Worked like a charm Link to comment Share on other sites More sharing options...
bodecsgabor Posted March 26, 2017 Share Posted March 26, 2017 thx!! Link to comment Share on other sites More sharing options...
David S Johnston Posted May 17, 2019 Share Posted May 17, 2019 excellent, just what I was looking for! Thanks! still works in 1.6.1.24 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now