Re: www. not working
| From: | Daniel Brown | Date: | Fri, 15 Feb 2008 20:54:27 +0000 |
| Subject: | Re: www. not working | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-269383@lists.php.net to get a copy of this message | ||
I'm sorry, the thread to which I was referring is "check if
website has www. in front of domain".
On Fri, Feb 15, 2008 at 3:50 PM, Daniel Brown <parasane@gmail.com> wrote:
> Go back to the original thread you started (https ....).
>
>
>
> On Fri, Feb 15, 2008 at 3:46 PM, nihilism machine
> <nihilismmachine@gmail.com> wrote:
> > this still does not work, if a domain has no preceeding www. it
> > redirects to http://www.www.site.com, if it has a www.
> > it goes to www.www.mydomain.com
> > , any ideas?
> >
> > <?php
> >
> > class URL {
> >
> > // Public Variables
> > public $ServerName;
> > public $WWW;
> >
> > // Public Functions
> >
> > public function __construct() {
> > $this->checkWWW();
> > $this->ServerName = $_SERVER['SERVER_NAME'] .
> > $_SERVER['REQUEST_URI'];
> > }
> >
> > // Check if site is preceeded by 'WWW'
> > public function checkWWW() {
> > $myDomain = $_SERVER['SERVER_NAME'];
> > $FindWWW = 'www.';
> > $POS = strpos($myDomain, $FindWWW);
> > if ($POS === 1) {
> > $this->WWW = true;
> > } else {
> > $this->WWW = false;
> > }
> > }
> >
> > // Redirect to WWW
> > public function WWWRedirect() {
> > if ($this->WWW == false) {
> > $redir = "Location:
> > http://www." . $this->ServerName;
> > header($redir);
> > }
> > }
> >
> > }
> >
> > $myURL = new URL();
> > $myURL->WWWRedirect();
> >
> > ?>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
> --
> </Dan>
>
> Daniel P. Brown
> Senior Unix Geek
> <? while(1) { $me = $mind--; sleep(86400); } ?>
>
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>