views:

29

answers:

1

Hi guys.
I forgot how to do that and I am stuck.
I have a site say www.example.com and another folder www.example.com/docs/ I want when some one visits the www.example.com/ he will be redirected secretly to www.example.com/docs/ but still see in the URL www.example.com

And even if the user types www.example.com/docs/ I want him to see www.example.com in the url
Simply the user will not know that there is a docs folder.

At the same time I want a user who visits a.example.com and b.example.com can visit them with no problem and will be prompted to enter a username and password.
Any help ?

+1  A: 

Try these rules:

RewriteCond %{THE_REQUEST} ^[A-Z]+\ /docs/
RewriteRule ^docs/(.*) /$1 [L,R=301]
RewriteRule !^docs/ docs%{REQUEST_URI}
Gumbo