.htaccess files are used to control directories. httpd needs to connect a server name with the directory. Having directories specify server names would be complicated. The prime use of .htaccess files is delegating control of a directory to someone without access to the main configuration. Configuring server names requires access to the main configuration. (Or a file added to the main config with Include, which has the same responsibility as being able to edit the main config.) Three scenarios: 1. httpd ignores server names. http://example.com http://www.example.com http://www.example.net If these URLs accessed the IP Address and port of httpd, they would receive the same response. 2. Named-based Virtual Hosts The ServerName and ServerAlias commands specify which VirtualHost section applies to which server names. 3. Rewrite based on server name. A complicated method to implement name-based virtual hosts. httpd must either use one configuration for all requests or use name-based virtual hosts. Any commands specifying different configurations for specific server names must be in the main configuration. Did I miss anything? solprovider On 1/22/09, J. Bakshi <joydeep@xxxxxxxxxxxxxxx> wrote: > I have a site which can be accessed by both http://example.com as well > as http://www.example.com > > I like to make an arrangement by .htaccess that both the link always > stick to http://www.example.com > > Could any one suggest how can I do this with .htaccess ? > Thanks --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx