I'm trying to set up a config in Apache so that only one IP address has access to the site, but so that a friendly 403 error is shown to other people.
I have the below code, whcih effectivly works, but because of the restricted access to the location of the 403.php file, showing the custom 403 is also forbidden.
The reason for doing this way is because 403.php needs to reference some functions (get_header()
, get_footer()
, etc) so I have to have it in this location.
Is anyone able to provide some assistence or advice? Thanks.
<VirtualHost *:80>
ServerName dummy.dynedrewett.com
ServerAlias dummy
DocumentRoot /var/www/html/intranet/intranet_test
ErrorLog /var/log/httpd/dummy.dynedrewett.com-error
CustomLog /var/log/httpd/dummy.dynedrewett.com-access combined
ErrorDocument 403 /wp-content/themes/dyne_drewnett/403.php
</VirtualHost>
<Directory /var/www/html/intranet/intranet_test/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from 192.168.1.47
</Directory>