Re: [PHP] turn off the www

2005-06-29 Thread Jochem Maas
[top posting out of spite] ;-) I'm guessing that the OP is only dealing with 1 domain? why not... ...only single quotes for extra speed :-) and no extraneous $newurl var either. John Nichel wrote: Ross wrote: now. I am using the following code to turn http into https and get my ssl wo

Re: [PHP] turn off the www

2005-06-29 Thread André Medeiros
People have fun with the oddest things ;) Anyway, it's a nice reference to have around :) On 6/29/05, Philip Hallstrom <[EMAIL PROTECTED]> wrote: > > OK OK I got it ;) > > > > I just suggested it because I thought he could assume that "www." > > would always be on the string. > > > > Either way,

Re: [PHP] turn off the www

2005-06-29 Thread Philip Hallstrom
OK OK I got it ;) I just suggested it because I thought he could assume that "www." would always be on the string. Either way, I guess _one_ preg_replace is alright. Heh :-) Just for kicks... - randomly prefix "www." onto 1324 proper names (dictionary file). 659 end up with "www." prefixed.

Re: [PHP] turn off the www

2005-06-29 Thread André Medeiros
OK OK I got it ;) I just suggested it because I thought he could assume that "www." would always be on the string. Either way, I guess _one_ preg_replace is alright. On 6/29/05, Kevin L'Huillier <[EMAIL PROTECTED]> wrote: > > > Wouldn't > > > > > > $newUrl = 'https://' . substr( $_SERVER['SERVER

Re: [PHP] turn off the www

2005-06-29 Thread Kevin L'Huillier
> > Wouldn't > > > > $newUrl = 'https://' . substr( $_SERVER['SERVER_NAME'], 4 ) > > > > be a _hell_ of a lot faster? > > If one considers micro-seconds 'a _hell_ of a lot faster', then _maybe_ And it could be slower if you avoid sending someone from http://example.com/ to https://ple.co

Re: [PHP] turn off the www

2005-06-29 Thread Philip Hallstrom
On Wed, 2005-06-29 at 10:57 -0700, Philip Hallstrom wrote: I am using the following code to turn http into https and get my ssl working. if($HTTP_SERVER_VARS["HTTPS"] != "on") { $newurl = "https://"; . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; header("location: $newurl"); } $newurl

Re: [PHP] turn off the www

2005-06-29 Thread John Nichel
André Medeiros wrote: $newurl = "https://"; . ereg_replace("^www.", "", $_SERVER["SERVER_NAME"]).. Wouldn't $newUrl = 'https://' . substr( $_SERVER['SERVER_NAME'], 4 ) be a _hell_ of a lot faster? If one considers micro-seconds 'a _hell_ of a lot faster', then _maybe_ -- Jo

Re: [PHP] turn off the www

2005-06-29 Thread André Medeiros
On Wed, 2005-06-29 at 10:57 -0700, Philip Hallstrom wrote: > > I am using the following code to turn http into https and get my ssl > > working. > > > > if($HTTP_SERVER_VARS["HTTPS"] != "on") > > { > > $newurl = "https://"; . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; > > header("location

Re: [PHP] turn off the www

2005-06-29 Thread John Nichel
Ross wrote: now. I am using the following code to turn http into https and get my ssl working. if($HTTP_SERVER_VARS["HTTPS"] != "on") { $newurl = "https://"; . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; header("location: $newurl"); } However I set the ssl up on http://mydomain.

Re: [PHP] turn off the www

2005-06-29 Thread Philip Hallstrom
I am using the following code to turn http into https and get my ssl working. if($HTTP_SERVER_VARS["HTTPS"] != "on") { $newurl = "https://"; . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; header("location: $newurl"); } $newurl = "https://"; . ereg_replace("^www.", "", $_SERVER["SERVER_N