How do you restrict directory access by IP address using htaccess?
From Joomla! Documentation
(Difference between revisions)
(New page: '''Overview''' This can be a very effective way to protect your Joomla! administrator directory. Any other directory in public_html can be protected in the same way. This method only work...) |
m (Hutchy68 moved page How do you restrict directory access by IP address using .htaccess? to How do you restrict directory access by IP address using htaccess?: fixing page not accessible) |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 18: | Line 18: | ||
100.100.100.101, 100.100.100.102 | 100.100.100.101, 100.100.100.102 | ||
| − | [[Category:FAQ]] | + | <noinclude>[[Category:FAQ]] |
[[Category:Administration FAQ]] | [[Category:Administration FAQ]] | ||
[[Category:Getting Started FAQ]] | [[Category:Getting Started FAQ]] | ||
[[Category:Installation FAQ]] | [[Category:Installation FAQ]] | ||
[[Category:Version 1.5 FAQ]] | [[Category:Version 1.5 FAQ]] | ||
| + | [[Category:Security]]</noinclude> | ||
Latest revision as of 21:49, 10 October 2012
Overview
This can be a very effective way to protect your Joomla! administrator directory. Any other directory in public_html can be protected in the same way. This method only works if you have a static IP address assigned to you. Anyone attempting to browse such directories using a different IP Address will get a 403 Forbidden error.
Directions
- In the directory you wish to protect, open (or create) a file called, .htaccess. (Note the dot at the beginning of the file name.)
- Add the following code to this file, replacing 100.100.100.100 in this example with the static IP address you plan to allow:
Order Deny,Allow Deny from all Allow from 100.100.100.100
- Optional: You can enter partial IP Addresses, such as, 100.100.100. This allows access to a range of addresses.
- Optional: You can add multiple addresses by separating them with comma's.
100.100.100.101, 100.100.100.102