forward http:// to http://www every time?

This is a discussion on forward http:// to http://www every time? within the PHP General forums, part of the PHP Programming Forums category; Is there a way to forward any browser query of http://mysite.com/anything/anything to http://www.mysite.com/...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-27-2006
Alex
 
Posts: n/a
Default forward http:// to http://www every time?

Is there a way to forward any browser query of
http://mysite.com/anything/anything to
http://www.mysite.com/anything/anything?

Anyone know?

Reply With Quote
  #2 (permalink)  
Old 08-27-2006
ZeldorBlat
 
Posts: n/a
Default Re: forward http:// to http://www every time?


Alex wrote:
> Is there a way to forward any browser query of
> http://mysite.com/anything/anything to
> http://www.mysite.com/anything/anything?
>
> Anyone know?


if(strpos($_SERVER['HTTP_HOST'], 'www') !== 0) {
$newURL = 'http://www.' . $_SERVER['HTTP_HOST'] .
$_SERVER['REQUEST_URI'];
header("Location: $newURL");
}

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:01 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0