简体   繁体   中英

server-status in wordpress htaccess

I want to enable server-status from mod_status

I have this on .htaccess file

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !=/server-status
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

httpd.conf is

<Location /server-status>
    SetHandler server-status
    Order Allow,Deny
    Deny from all
    Allow from 111.11.1.1
</Location>

I'm using my external IP. I'm using this website to know my IP address. https://www.whatismyip.com/

But when I access example.com/server-status it's a 403 forbidden but then when I change the http conf to allow from all it can be accessed but I want it to only be accessible to my computer

Directive Order can be tricky, maybe that's the reason why it is deprecated.

Nevertheless, when you want to use it, just go by the examples in the documentation

In the following example, all hosts in the example.org domain are allowed access; all other hosts are denied access.

  Order Deny,Allow Deny from all Allow from example.org 

Do you see the different order of Deny,Allow ?


To use the current Require directive, this should work

Require ip 111.11.1.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM