Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
share|improve this question

migrated from superuser.com Mar 2 '12 at 11:55

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

1  
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
1  
stijn, you should repost your comment as answer, so that David can mark this question answered... –  larsks Mar 2 '12 at 15:20
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.