Reply to Re: [PHP] turn off the www

Your name:

Reply:


Posted by Andrι Medeiros on 06/29/05 22:03

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 = "https://" . ereg_replace("^www.", "", $_SERVER["SERVER_NAME"])......

Wouldn't

$newUrl = 'https://' . substr( $_SERVER['SERVER_NAME'], 4 ) ........

be a _hell_ of a lot faster?

>
>
> >
> >
> > However I set the ssl up on http://mydomain.com not http://www.mydomain.com
> > and it give me a warning which I do not want the users to see.
> >
> > Can I do someting to make any page automatically redirtect as above using
> > https WITHOUT the www in this format
> >
> > https://mydomain.com
> >
> >
> > thanks
> >
> > R.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация