f



Should I use "SERVER_NAME" or "HTTP_HOST"

After reading the site: http://shiflett.org/blog/2006/mar/server-name-versus-http-host

Is that mean we should better use the 'SERVER_NAME' instead of
"HTTP_HOST"?
0
howachen (521)
2/1/2009 3:51:34 PM
comp.lang.php 32646 articles. 0 followers. Post Follow

5 Replies
994 Views

Similar Articles

[PageSpeed] 29

howa wrote:
> After reading the site: http://shiflett.org/blog/2006/mar/server-name-versus-http-host
> 
> Is that mean we should better use the 'SERVER_NAME' instead of
> "HTTP_HOST"?

Well it would depend on the context, wouldn't it?
0
arestes (103)
2/1/2009 6:12:48 PM

Hugh Oxford wrote:
> howa wrote:
> > After reading the site: http://shiflett.org/blog/2006/mar/server-name-versus-http-host
> >
> > Is that mean we should better use the 'SERVER_NAME' instead of
> > "HTTP_HOST"?
>
> Well it would depend on the context, wouldn't it?

I have multiple domain listening on the same IP/port. So my php need
to find out which domain user is requesting for.
So should I use which of them is more reliable/secure?
0
howachen (521)
2/2/2009 4:11:01 AM
howa wrote:
> 
> Hugh Oxford wrote:
>> howa wrote:
>>> After reading the site: http://shiflett.org/blog/2006/mar/server-name-versus-http-host
>>>
>>> Is that mean we should better use the 'SERVER_NAME' instead of
>>> "HTTP_HOST"?
>> Well it would depend on the context, wouldn't it?
> 
> I have multiple domain listening on the same IP/port. So my php need
> to find out which domain user is requesting for.
> So should I use which of them is more reliable/secure?

hopefully the are not all using the same DocumentRoot.  If they are - 
could cause you more problems than you want to get into.  If they all do 
  the same thing - well - I suppose there is a good reason to do so... 
My server (web/db) has 5 domains - all with their own DocumentRoot, all 
with access to the same database.  This way I ALWAYS know what domain 
name they are connecting to by the documentroot.
0
maustin (1437)
2/2/2009 4:36:01 AM
On Feb 2, 12:36=A0pm, Michael Austin <maus...@firstdbasource.com> wrote:
> howa wrote:
>
> > Hugh Oxford wrote:
> >> howa wrote:
> >>> After reading the site:http://shiflett.org/blog/2006/mar/server-name-=
versus-http-host
>
> >>> Is that mean we should better use the 'SERVER_NAME' instead of
> >>> "HTTP_HOST"?
> >> Well it would depend on the context, wouldn't it?
>
> > I have multiple domain listening on the same IP/port. So my php need
> > to find out which domain user is requesting for.
> > So should I use which of them is more reliable/secure?
>
> hopefully the are not all using the same DocumentRoot. =A0If they are -
> could cause you more problems than you want to get into. =A0If they all d=
o
> =A0 the same thing - well - I suppose there is a good reason to do so...
> My server (web/db) has 5 domains - all with their own DocumentRoot, all
> with access to the same database. =A0This way I ALWAYS know what domain
> name they are connecting to by the documentroot.

Yes, same DocumentRoot.


0
howachen (521)
2/2/2009 6:50:33 AM
On Feb 2, 2:50=A0pm, howa <howac...@gmail.com> wrote:
> On Feb 2, 12:36=A0pm, Michael Austin <maus...@firstdbasource.com> wrote:
>
>
>
>
>
> > howa wrote:
>
> > > Hugh Oxford wrote:
> > >> howa wrote:
> > >>> After reading the site:http://shiflett.org/blog/2006/mar/server-nam=
e-versus-http-host
>
> > >>> Is that mean we should better use the 'SERVER_NAME' instead of
> > >>> "HTTP_HOST"?
> > >> Well it would depend on the context, wouldn't it?
>
> > > I have multiple domain listening on the same IP/port. So my php need
> > > to find out which domain user is requesting for.
> > > So should I use which of them is more reliable/secure?
>
> > hopefully the are not all using the same DocumentRoot. =A0If they are -
> > could cause you more problems than you want to get into. =A0If they all=
 do
> > =A0 the same thing - well - I suppose there is a good reason to do so..=
..
> > My server (web/db) has 5 domains - all with their own DocumentRoot, all
> > with access to the same database. =A0This way I ALWAYS know what domain
> > name they are connecting to by the documentroot.
>

Yes, same DocumentRoot.
Since different domain is for different countries, but they are using
the same set of program

Any drawback for my current settings?
0
howachen (521)
2/2/2009 7:05:49 AM
Reply: