Thread: SSL and PHP
View Single Post
Old 11-05-2009, 09:00 PM   #10 (permalink)
bufster007
Recruit
 
Join Date: Jul 2008
Posts: 21
bufster007 is on a distinguished road
Thanks DJMaze and sde,

I have included both your code as it was great advice to cover all bases.

When I echo'd it out it was www.mydomain.com, However it kept redirecting rather then letting through www.mydomain.com or mydomain.com so I tried

PHP Code:
if($host != "mydomain.com" && $host != "www.mydomain.com"){

and 
tried

if($host != "mydomain.com" || $host != "www.mydomain.com"){ 
but it redirected each time, so I ended up with

PHP Code:
if($host != "www.mydomain.com"){ 
As it should always be this generally and it works fine.

Unless they navigate to the site using http://mydomain.com in which case the first link they click on will redirect them, or if they use the search box on the homepage that will redirect them.

Above it I added DJMazes check (very good point!). Thank you both very much.
bufster007 is offline   Reply With Quote