httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J. Bakshi" <joyd...@infoservices.in>
Subject Re: [users@httpd] How can I stick with www only ?
Date Thu, 22 Jan 2009 09:25:18 GMT
solprovider@apache.org wrote:
> .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?
>   

Hello,

Thanks a lot for the clarification.
I'm using a shared hosting space to run my own site. So I don't have any
access to httpd.conf
both www and non www points to my site but I also have realurl installed
there. So I have to stick with either www or non www . So I have decided
to stick with www.

I have found the .htaccess configuration which always change
http://mysite to http://www.mysite

~~~~~~~~~~~~~~~~~~~~```
RewriteCond %{HTTP_HOST} ^mysite.com [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]
~~~~~~~~~~~~~~~~~~~~~~~~~

Thanks

> solprovider
>
> On 1/22/09, J. Bakshi <joydeep@infoservices.in> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>   


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Joydeep Bakshi, Linux System Admin
Kolkatainfoservices Pvt Ltd,
23A Royd Street, Kolkata 700016, India
Work Phone 91 033 40014784
http://infoservices.in/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message