http, https, hostname ( www ) and domain_name ( mydomain.com )
http, https, hostname ( www ) and domain_name ( mydomain.com )
am 05.08.2002 11:29:25 von EdwardSPL
Hello,
Who can help me what different between Redirect, ServerAlias and
Rewrite ?
I'm going to set the functon ( http auto direct to https , domain.com
auto direct to www.domain.com )...
I want to know which one is good for me... thanks !
Edward.
Re: http, https, hostname ( www ) and domain_name ( mydomain.com )
am 05.08.2002 16:12:12 von Robert Andersson
EdwardSPL@ita.org.mo wrote:
> Hello,
>
> Who can help me what different between Redirect, ServerAlias and
> Rewrite ?
> I'm going to set the functon ( http auto direct to https , domain.com
> auto direct to www.domain.com )...
> I want to know which one is good for me... thanks !
>
> Edward.
You cannot use ServerAlias at all, as it can only live within one VHost, and
the HTTP and HTTPS needs their own.
You can use Rewrite rules to do this, but I think you also can do it with
Redirect. And if so, you should always choose Redirect above Rewrite
(faster, simpler, etc.). So what I think you should do, which I believe I've
pointer out numerous times, is to use a directive like this in your "normal"
VHost:
ServerName domain.com
ServerAlias www.domain.com
Redirect / https://www.domain.com
ServerName domain.com
...
I ask some knowledgable person who read this to verify that two VHost can
have the same name when on different ports, but I strongly suspect that to
be the case.
Regards,
Robert Andersson
Re: http, https, hostname ( www ) and domain_name ( mydomain.com )
am 05.08.2002 16:32:32 von Jack Nerad
On Mon, 2002-08-05 at 10:12, Robert Andersson wrote:
> EdwardSPL@ita.org.mo wrote:
> > Hello,
> >
> > Who can help me what different between Redirect, ServerAlias and
> > Rewrite ?
> > I'm going to set the functon ( http auto direct to https , domain.com
> > auto direct to www.domain.com )...
> > I want to know which one is good for me... thanks !
> >
> > Edward.
>
> You cannot use ServerAlias at all, as it can only live within one VHost, and
> the HTTP and HTTPS needs their own.
> You can use Rewrite rules to do this, but I think you also can do it with
> Redirect. And if so, you should always choose Redirect above Rewrite
> (faster, simpler, etc.). So what I think you should do, which I believe I've
> pointer out numerous times, is to use a directive like this in your "normal"
> VHost:
>
>
> ServerName domain.com
> ServerAlias www.domain.com
> Redirect / https://www.domain.com
>
>
>
> ServerName domain.com
> ...
>
>
> I ask some knowledgable person who read this to verify that two VHost can
> have the same name when on different ports, but I strongly suspect that to
> be the case.
>
just a caveat.
"Name-based virtual hosting cannot be used with SSL secure servers
because of the nature of the SSL protocol"
(http://httpd.apache.org/docs/vhosts/name-based.html)
I can't tell if this is a name based setup or not.
If it is an IP based setup, then it should be okay
"Each VirtualHost must correspond to a different IP address, _different
port number_ or a different host name for the server. . . ."
http://httpd.apache.org/docs/mod/core.html#virtualhost
> Regards,
> Robert Andersson
>
>
> ------------------------------------------------------------ ---------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Re: http, https, hostname ( www ) and domain_name ( mydomain.com )
am 05.08.2002 17:44:43 von EdwardSPL
Hi,
I want to know what different between Redirect, ServerAlias and Rewrite
really...
So, who can help me about this with simply sentences ?
Thank a lots !
Edward.
Robert Andersson wrote:
> EdwardSPL@ita.org.mo wrote:
> > Hello,
> >
> > Who can help me what different between Redirect, ServerAlias and
> > Rewrite ?
> > I'm going to set the functon ( http auto direct to https , domain.com
> > auto direct to www.domain.com )...
> > I want to know which one is good for me... thanks !
> >
> > Edward.
>
> You cannot use ServerAlias at all, as it can only live within one VHost, and
> the HTTP and HTTPS needs their own.
> You can use Rewrite rules to do this, but I think you also can do it with
> Redirect. And if so, you should always choose Redirect above Rewrite
> (faster, simpler, etc.). So what I think you should do, which I believe I've
> pointer out numerous times, is to use a directive like this in your "normal"
> VHost:
>
>
> ServerName domain.com
> ServerAlias www.domain.com
> Redirect / https://www.domain.com
>
>
>
> ServerName domain.com
> ...
>
>
> I ask some knowledgable person who read this to verify that two VHost can
> have the same name when on different ports, but I strongly suspect that to
> be the case.
>
> Regards,
> Robert Andersson
Do you agree to use Redirect rather than ( Rewrite, ServerAlias, etc... ) ?
RE: http, https, hostname ( www ) and domain_name ( mydomain.com )
am 06.08.2002 09:28:05 von Boyle Owen
>From: Robert Andersson [mailto:robert@profundis.nu]
>
>
> ServerName domain.com
> ServerAlias www.domain.com
> Redirect / https://www.domain.com
>
>
>
> ServerName domain.com
> ...
>
>
>I ask some knowledgable person who read this to verify that=20
>two VHost can
>have the same name when on different ports, but I strongly=20
>suspect that to
>be the case.
ServerName serves two purposes; Its primary function is to allow apache =
to make self-referential URLs (i.e. When redirecting, apache has to =
make URLs which come back to the server). Secondly, it allows apache to =
distinguish between name-based VHs (but then only if NameVirtualHost has =
been defined).
In the case above, the two VHs are distinguished by port number so there =
is no conflict with the repeated ServerName.=20
Rgds,
Owen Boyle
Re: http, https, hostname ( www ) and domain_name ( mydomain.com )
am 06.08.2002 11:24:37 von EdwardSPL
Boyle Owen wrote:
> >From: Robert Andersson [mailto:robert@profundis.nu]
> >
> >
> > ServerName domain.com
> > ServerAlias www.domain.com
> > Redirect / https://www.domain.com
> >
> >
> >
> > ServerName domain.com
> > ...
> >
> >
> >I ask some knowledgable person who read this to verify that
> >two VHost can
> >have the same name when on different ports, but I strongly
> >suspect that to
> >be the case.
>
> ServerName serves two purposes; Its primary function is to allow apache to make self-referential URLs (i.e. When redirecting, apache has to make URLs which come back to the server). Secondly, it allows apache to distinguish between name-based VHs (but then only if NameVirtualHost has been defined).
>
> In the case above, the two VHs are distinguished by port number so there is no conflict with the repeated ServerName.
>
> Rgds,
>
> Owen Boyle
So, do you recommend to use Redirect rather than ServerAlias and Rewrite for the setting of Apache ?
Edward.
RE: http, https, hostname ( www ) and domain_name ( mydomain.com )
am 06.08.2002 11:39:16 von Boyle Owen
>From: EdwardSPL@ita.org.mo [mailto:EdwardSPL@ita.org.mo]
>
>So, do you recommend to use Redirect rather than ServerAlias=20
>and Rewrite for the setting of Apache ?
As a general principle, always try to use the simplest technique which =
does the job. So if you can achieve what you want with a redirect rule, =
use that.
This is not to discourage the use of mod_rewrite; this is a very =
powerful module which allows you to do almost anything. However, it is a =
bit complicated and if you can do what you want with a simpler set of =
directives then you should probably do so.
Rgds,
Owen Boyle