Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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>
        ServerAlias dummy
        DocumentRoot /var/www/html/intranet/intranet_test
        ErrorLog /var/log/httpd/
        CustomLog /var/log/httpd/ combined
        ErrorDocument 403 /wp-content/themes/dyne_drewnett/403.php

<Directory /var/www/html/intranet/intranet_test/>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from
share|improve this question

migrated from Mar 2 '12 at 11:55

This question came from our site for computer enthusiasts and power users.

has been a while since I configured apache, but can't you just add a Directory section for /wp-content/themes/dyne_drewnet allowing access to All ? – stijn Mar 2 '12 at 11:27
That simple! It does pose a few challenges with some required files not being included, but that is very fixable. Thanks for your help. – David Gard Mar 2 '12 at 14:26
stijn, you should repost your comment as answer, so that David can mark this question answered... – larsks Mar 2 '12 at 15:20
up vote 1 down vote accepted

Adding a seperate <Directory> section for /wp-content/themes/dyne_drewnet allowing access to All should fix the access problem.

share|improve this answer
Thanks for the help :) – David Gard Mar 5 '12 at 11:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.