0

How to access a site in maintenance mode with a dynamic IP while others keep seeing the maintenance mode?

I can add my IP address to var/maintenance.ip and get access the admin / frontend.

But my IP changes every 24 hours and I have to add the new one again.

Is there a way to do this without me adding my new IP every time?

3

You could create a php file www.domain.com/xyz123.php that could add/overwrite your new current dynamic ip to the var/.maintenance.ip file thus updating your ip just by visiting the file instead of having to manually add your new ip.

i would do something like this:

  1. does var/.maintenance.flag exist? if no, maintenance mode is off. do nothing & exit
  2. overwrite or create var/.maintenance.ip with my current dynamic ip address
  • Really nice answer. Easy and straight forward. One thing I want to add that you can setup cron to run every hour to run you PHP file. – Mohit Kumar Arora Sep 6 '17 at 5:15
  • @MohitKumarArora i dont think he can use cron to run this file because it needs his current dynamic ip address (home internet) that changes every 24 hours. he would have to visit this page before visiting his magento index to update it with his current ip. – Blitzo Sep 8 '17 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.