views:

45

answers:

1

I have a rails app that has a private component and a public component.

www.hostname.com/ is private and should only be accessed from inside our firewall, but i want to allow access to www.hostname.com/public to internet users. I played around with the apache vhost config but it seems when I allow access to www.hostname.com it allows all the paths below it as well. Any help would be very appreciated.

+1  A: 

in your web root (/var/www) create this .htaccess file:

Order deny,allow
Deny from all
allow from 192.168.0.0/24

In your public folder (/var/www/public) create a new .htaccess folder that contains this line:

allow from all

Make sure .htaccess overrides is enabled in your apache/vhost configs, this should be enabled by default.

Rook
Thank you, This seems to be working!
Dale
@Dale happy to help!
Rook