Web Hosting Talk







View Full Version : How to Redirect Whole Directories?


beppi
05-17-2002, 02:06 AM
Hi there,

My provider supports subdomains created by having a directory sub.domain.com in the main HTML directory. This directory is then accessible as http://sub.domain.com as well as http://domain.com/sub.domain.com.

Now, what I want to do is to redirect all incoming requests for http://sub.domain.com/file to a user's home directory http://domain.com/~user/file (so the user can access and change his files but not my main site). Only if file does not exist in ~user, an error message should be given, and I don't want to rewrite something every time the user changes his file names.

How can I do that? I do not have ASP, but .htaccess and PHP.

Thanks for any suggestions,
Frank

roly
05-17-2002, 02:26 AM
In .htaccess

Redirect / http://www.domain.com/user