I have an idea below text in .htaccess file in magento root folder. Order allow,deny tells your web server that the Allow rules are processed before the Deny rules. Order deny, allow means that the deny rules are processed before the allow rules.


By default allow all access

Order allow,deny
Allow from all

After that i added below text "Deny from"

above ip address is my system public ip address.But still i able to access magento site(localhost)

and through cmd ipconfig command i get different ip now .using that ip address also i'm able to access my site. So where my configuration is wrong.Thanks in advance.

4 Answers 4

order deny,allow
deny from all
allow from 111.222.333.444

When you access localhost (even when you use full name or IP address) your client machine identifies itself as (it's localhost IP equivalent). Since is not in your deny list, it allows you to continue.

If you want to investigate this thing further, use PHP to print out $_SERVER["REMOTE_ADDR"] to see how server recognises your client machine.

  • now i'm adding to deny list.but still i can access.Please once try this thing.
    – sivakumar
    May 23, 2014 at 12:30
  • Well, this should work order allow,deny deny from deny from deny from 123.123.* allow from all should work, unless you are using wrong scope (such as specific subfolder).
    – Pronto
    May 23, 2014 at 12:43
  • Few additional ideas: are you sure that .htaccess file is accessible for Apache? Are you sure that there no overriding directives, such as <Directory />? Are you sure that there's no AllowOverride None somewhere?
    – Pronto
    May 23, 2014 at 15:31

Add the following lines on bottom of root .htaccess file:

Order deny,allow
Deny from all
Allow from

Come and edit the htaccess file to limit the sole to IP only ONLY for some subdomains (and keep all IPs for the main site)? Thanks


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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