Site icon Hip-Hop Website Design and Development

Query with loading 403/ 404 error pages and htaccess

I uploaded an html 403 and 404 web page to my WordPress theme listing and if I hit a random mistake after .com corresponding to .com/yyyy then it masses the 404 web page for instance – so all is sweet…

Nevertheless…I would really like the 403.php to be proven when somebody outdoors my permitted IP string makes an attempt to entry my log in web page.

This .htaccess rule works nice BUT it create a endless loop as WordPress tries to search out the 403.php web page..

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} ^(.*)?wp-login.php(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
RewriteCond %{REMOTE_ADDR} !^111.111.22.33$
RewriteRule ^(.*)$ - [R=403,L]
</IfModule> 

So you’ll be able to see on the final line that there’s R=403 which is looking for the 403 web page, however it could possibly’t discover it…

I subsequently added the next traces (making an attempt separately) however they didnt work:

ErrorDocument 403 /403.php
ErrorDocument 404 /404.php

after which I attempted

ErrorDocument 403 /index.php?error=403
ErrorDocument 404 /index.php?error=404

And no pleasure…

Ought to the 403 and 404 template have WordPress particular php on the prime of the template?

Or – how am i able to appropriately name the 403.php when the consumer WITHOUT the right IP handle tries to entry the log in web page?

Thanks!