Reply to Re: [PHP] turn off the www

Your name:

Reply:


Posted by Philip Hallstrom on 06/29/05 21:13

> 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?

Only if he can gaurantee that $_SERVER['SERVER_NAME'] *ALWAYS* is prefixed
with "www." Otherwise he might end up with chost.com instead of
aztechost.com...

-philip

[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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация