Title: wp-admin redirection and Apache DirectoryMatch rules
Last modified: August 19, 2016

---

# wp-admin redirection and Apache DirectoryMatch rules

 *  [wltj](https://wordpress.org/support/users/wltj/)
 * (@wltj)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/wp-admin-redirection-and-apache-directorymatch-rules/)
 * I would like to restrict access to my /wp-admin folder so that I can ONLY access
   it from within my home network via its private, internal ip:
    `[http]://192.168.1.2/
   wordpress/wp-admin` and anybody accessing it via its public ip gets blocked.
 * My rules are:
 *     ```
       <DirectoryMatch /wordpress/wp-admin>
               Order Deny,Allow
               Deny from all
               Allow from 192.168.1.3
               Allow from 192.168.1.4
       </DirectoryMatch>
       ```
   
 * I have the same rule set for myphpadmin and it works as expected. But for wp-
   admin, wordpress automatically redirects the request to its public ip. So even
   when I type `[http]://192.168.1.2/wordpress/wp-admin` in my browser, wordpress
   automatically redirects to its public ip:
    `[http]://my.public.ip.addr/wordpress/
   wp-login.php?redirect_to=http://192.168.1.2/wordpress/wp-admin/&reauth=1`
 * therefore the wp-admin directory is still inaccessible even from within my internal
   network. Is there a way to stop this redirection so I can access the wp-admin
   directly from its private ip?

The topic ‘wp-admin redirection and Apache DirectoryMatch rules’ is closed to new
replies.

## Tags

 * [apache](https://wordpress.org/support/topic-tag/apache/)
 * [deny](https://wordpress.org/support/topic-tag/deny/)
 * [network](https://wordpress.org/support/topic-tag/network/)
 * [redirect](https://wordpress.org/support/topic-tag/redirect/)
 * [wp-admin](https://wordpress.org/support/topic-tag/wp-admin/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [wltj](https://wordpress.org/support/users/wltj/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/wp-admin-redirection-and-apache-directorymatch-rules/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
