|
Posted by Rik Wasmus on 01/06/08 02:23
On Sun, 06 Jan 2008 03:09:48 +0100, flowover <flowover.73@gmail.com> wrote:
> 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.
>
> mod_rewrite is faster as it happens inline with the http headers on
> the fly. It's just more complex.
mod_rewrite is unnecessary overhead if the php codebase remains the same.
The $_SERVER array will still be filled, it can still be compared to
lightingly fast.
--
Rik Wasmus
[Back to original message]
|