I'm using below htaccess file to prevent unauthorized access to Magmi.


Order deny,allow
Deny from all
Allow from xxx.xxx.xxx.xxx

this htaccess file is working fine when I'm trying to access Magmi from a browser but it's preventing me to access Magmi when I'm trying to call magmi script from observer using curl.

I've added and server IP in htaccess to whitelist server itself but it's still not allowing me to access Magmi from the observer.

How can I whitelist server itself so that I can call Magmi script from Magento observer?

Thanks in advance.


make a curl to http://canihazip.com/s to find out the IP of the webserver when making remote requests. It could be this differs from the incomming server IP.

Add that IP to your whitelist.

Alernatify, you can dump the $_SERVER['REMOTE_ADDR'] with a die(); in the index.php and remove the .htaccess block. Make a curl, see what the IP is, add that to the .htaccess whitelist.

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.