Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 need to install a second web application site on a web server and hide the fact that's the same server to user.

So far, I have a web app XYZ that you can access via and which is located on the server somewhere like /var/www/ I need to add another webapp ABC which is located /var/www/abc/ and only permit access to people using the ip address.

i.e :  --> XYZ ( /var/www/ ) --> ABC ( /var/www/abc )

I've absolutely no clue how to do that with htaccess. Any help is more than welcomed !


share|improve this question
I forget that I would like the final url of the ABC web app to be NOT – user14728 Aug 11 '09 at 9:54
up vote 4 down vote accepted

This isn't really a htaccess thing, more of a vhost setup thing.

share|improve this answer
After talking with the tech guy at my provider, it's the way we will go. Thank you. – user14728 Aug 12 '09 at 7:53

Place a .htaccess in /var/www/abc

Order deny,allow
Deny from all
Allow from

RewriteCond %{HTTP_HOST} ^$ [NC]
RewriteRule ^(.*)$ - [R=404,L]

This should give visitors to a 404 (Not found) when they try to access (R=404 is undocumented but should work)

(note untested, but you get the idea)

share|improve this answer
Ryaner has the correct answer, mine was based on that he wanted to protect the /abc/ folder and that VirtualHosting was already setup. My use of 404 as error is to hide the fact that there are a /abc/ folder. – rkthkr Aug 11 '09 at 11:06

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.