1

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 122.179.87.208"

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.

3
order deny,allow
deny from all
allow from 111.222.333.444
| improve this answer | |
2

When you access localhost (even when you use full name or IP address) your client machine identifies itself as 127.0.0.1 (it's localhost IP equivalent). Since 127.0.0.1 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.

| improve this answer | |
  • now i'm adding 127.0.0.1 to deny list.but still i can access.Please once try this thing. – sivakumar May 23 '14 at 12:30
  • Well, this should work order allow,deny deny from 123.123.123.123 deny from 123.123.123.123/30 deny from 123.123.* allow from all should work, unless you are using wrong scope (such as specific subfolder). – Pronto May 23 '14 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 '14 at 15:31
1

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

Order deny,allow
Deny from all
Allow from 119.82.68.252
| improve this answer | |
0

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

| improve this answer | |

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.