|
Posted by flowover on 01/06/08 02:09
On Jan 5, 5:46 am, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Sat, 05 Jan 2008 12:04:39 +0100, Jason Carlton <jwcarl...@gmail.com>
> wrote:
>
> > My question is, is this the best way to find which domain has been
> > entered?
>
> Yes, at least in Apache with PHP as a module it is.
>
> > Also, considering that I'm always battling speed issues on my
> > site, is there a faster option than $_SERVER['HTTP_HOST']?
>
> $_SERVER['HTTP_HOST'] is an automatically filled string allready available
> to you, anything faster is almost impossible. When trying to optimise, be
> sure to check where the bottlenecks are, don't guess. A variety of tools
> is available to you, I prefer XDebug.
>
> About the (pseudo?) code, I'd say you're better of using a switch
> statement then an if..else if...else if.. construct.
> --
> Rik Wasmus
mod_rewrite is faster as it happens inline with the http headers on
the fly. It's just more complex.
Navigation:
[Reply to this message]
|