Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

msjones

macrumors 6502
Original poster
Oct 18, 2007
429
4
Nottinghamshire, UK
Hi,

I have been asked to make an idevice friendly site for a friends business. I also did his main site and I host it for him. The site is: http://www.hdelectricalsystems.co.uk.

I have this piece of php code to detect the iDevice and forward to the relevent mobile site:

Code:
<?php
if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== FALSE || strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') !== FALSE) {
header("Location: http://www.hdelectricalsystems.co.uk/mobile/index.html"); }
?>

Now this is my problem, when I go to the domain, the forward takes me the mobile site no problem. However it looks like this:

photo2y.png


Which as you can see is not right. If I go to the direct site link using my server address: http://tuxserv.dlinkddns.com/sites/hd2/mobile/index.html it looks like this:

photo1f.png


Which is right... Can someone tell me what I'm doing wrong?

Thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.