Hafax Posted January 9, 2014 Share Posted January 9, 2014 Hi, I'm having a problem with my Prestashop. When I add my IP, in the Maintenance IP on Preferences > Maintance page of Back Office, I'm still not able to access my webpage, it just shows my maintenance message page.Anyone know what might be the problem? Link to comment Share on other sites More sharing options...
Sharak Posted January 10, 2014 Share Posted January 10, 2014 Are you sure you use the right IP? Use some sites from HERE Link to comment Share on other sites More sharing options...
Hafax Posted January 10, 2014 Author Share Posted January 10, 2014 Yes I am sure I'm using the correct IP, I entered the one I got from ipconfig in cmd prompt and also the one I got from http://myip.dk/, seperated with commas, none of which seem to work. Link to comment Share on other sites More sharing options...
Sharak Posted January 10, 2014 Share Posted January 10, 2014 Which presta version do you use? Tried maintenance IP on 1.5.6.1 and it works just fine. Link to comment Share on other sites More sharing options...
Hafax Posted January 10, 2014 Author Share Posted January 10, 2014 1.5.6.1 is the one we're using. If I add the IP of the server (That's the one it adds when I press add my IP) everyone can see the website, I tried it from 2 different computers atleast. If I use the other IP's noone has access... It's very annoying. Link to comment Share on other sites More sharing options...
Sharak Posted January 10, 2014 Share Posted January 10, 2014 It should be your IP, not the server's. Do you use your own server? Link to comment Share on other sites More sharing options...
Hafax Posted January 10, 2014 Author Share Posted January 10, 2014 I have meebox as a host for my website Link to comment Share on other sites More sharing options...
vekia Posted January 10, 2014 Share Posted January 10, 2014 90.185.47.*** you use this ip? or something different? i masked last part due your privacy Link to comment Share on other sites More sharing options...
Hafax Posted January 10, 2014 Author Share Posted January 10, 2014 Yes that's the IP I'm using Link to comment Share on other sites More sharing options...
zkagen Posted January 17, 2014 Share Posted January 17, 2014 I have the same problem. When I use my IP found on http://myip.dk/ I cannot access the frontoffice, however, if I click the Ad my IP from inside the maintenance module, I get a completely different IP, and then I can access my front office, but strangely enough, everybody can! I use meebox too. Any solotion? Link to comment Share on other sites More sharing options...
vekia Posted January 17, 2014 Share Posted January 17, 2014 you're on localhost? or on remote host? Link to comment Share on other sites More sharing options...
Cope Posted April 23, 2014 Share Posted April 23, 2014 Same problem here on two different sites (same host). Both sites are PS 1.6.0.6 (had same issue before upgrading from PS1.5). Both shops are on Meebox (Denmark). Add my IP gives me the domains IP which grants access to everybody . Adding my actual computer IP does not grant access. Any ideas?!? Link to comment Share on other sites More sharing options...
Hafax Posted April 24, 2014 Author Share Posted April 24, 2014 Hi. Replacing this function in classes/Tools.php worked for me /** * Get the server variable REMOTE_ADDR, or the first ip of HTTP_X_FORWARDED_FOR (when using proxy) * * @return string $remote_addr ip of client */ static function getRemoteAddr() { // This condition is necessary when using CDN, don't remove it. if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR'] AND (!isset($_SERVER['REMOTE_ADDR']) OR preg_match('/^127\..*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^172\.16.*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^192\.168\.*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^10\..*/i', trim($_SERVER['REMOTE_ADDR'])))) { if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')) { $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); return $ips[0]; } else return $_SERVER['HTTP_X_FORWARDED_FOR']; } return $_SERVER['REMOTE_ADDR']; } With this one /** * Get the server variable REMOTE_ADDR, or the first ip of HTTP_X_FORWARDED_FOR (when using proxy) * * @return string $remote_addr ip of client */ static function getRemoteAddr() { // This condition is necessary when using CDN, don't remove it. if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR']) { if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')) { $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); return $ips[0]; } else return $_SERVER['HTTP_X_FORWARDED_FOR']; } return $_SERVER['REMOTE_ADDR']; } Good luck. Keep the original somewhere so you have it if it doesn't work, so you can revert the changes. Link to comment Share on other sites More sharing options...
Ehinarr Posted August 30, 2014 Share Posted August 30, 2014 Hi. Replacing this function in classes/Tools.php worked for me It worked, thanks a lot. Link to comment Share on other sites More sharing options...
Belenguer Posted August 2, 2015 Share Posted August 2, 2015 tHX!!! Link to comment Share on other sites More sharing options...
giveit.ro Posted March 6, 2016 Share Posted March 6, 2016 great. it works. thank you! Link to comment Share on other sites More sharing options...
builders Posted May 11, 2016 Share Posted May 11, 2016 I have a similar problem, I use Proxy (Varnish) and i can not set my eshop at maintance mode as all users are seen as local 127.0.0.1. What shall i change in order to get the real ip of clients and have the maintance fuction to work ? Link to comment Share on other sites More sharing options...
Recommended Posts