Web Design Forums

PHP

Have questions about PHP? Ask them here and our experts will assist you before you know it! You can also find help in the documentation at PHP.net.

Mobile redirect script help needed



Site of the Month Voting - Now Open. CAST YOUR VOTE NOW!

Reply
 
LinkBack Thread Tools
Old February 28 '10, 01:26 AM (#1)
requestawebdesi is offline
New Member!
 
requestawebdesi's Avatar
 
Join Date: February 2010
Posts: 1
requestawebdesi is an unknown quantity at this point
Mobile redirect script help needed

I have a website that I wish to add a mobile redirect to. I purchased a php script from detectmobilebrowsers -dot- com. My site is done in html/css and I do not understand php. No matter what device (desktop or mobile) I want them to go to the main address (eg. mycompany.com). If they are on a desktop, I want them redirected to mycompany.com/index2.html. If they are on a mobile, I want them redirected to mycompany.com/mobile/ Is anyone familiar with how the script I mentioned earlier works? If so, a quick and simple would be extremely appreciated! This site is hosted on a hostgator shared plan if that matters.

Last edited by requestawebdesi; February 28 '10 at 01:48 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 28 '10, 01:28 PM (#2)
mlseim is offline
WDF Staff
 
mlseim's Avatar
 
Join Date: April 2004
Location: Cottage Grove, Minnesota
Posts: 3,359
mlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud of
It's not .com ... but here's the real address (OK to post on WDF):
http://detectmobilebrowsers.mobi/

I think you just have your main website, and everyone goes there.
If they are using a mobile browser, they are re-directed to the mobile
browser pages. I don't think you need another separate index2.html page
for the desktop users.

Keep your original site as-is, and make separate pages for the mobile users.

Here's the catch ...
If we knew what your original site was, we might be able to help better.
We don't know how many pages you have, and if your site is done with CSS files?
It's possible this could be easier than you think.

I'm not sure if any of us can deal with the "detectmobilebrowsers" script unless
we pay for it. So that might be hard for us to offer any examples, unless someone
else has used it (I have not).

Give us the URL to your existing site.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 28 '10, 04:51 PM (#3)
smoseley is online now
WDF Moderator
 
smoseley's Avatar
 
Join Date: March 2003
Location: Miami, FL
Posts: 8,719
smoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud ofsmoseley has much to be proud of
You should never redirect desktop users. Only mobile users. Otherwise, you could potentially kill your SEO.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 1 '10, 04:14 AM (#4)
MadRukus is offline
WDF Member
 
MadRukus's Avatar
 
Join Date: January 2010
Posts: 51
MadRukus has a little shameless behaviour in the past
I think that script needs to be on a php and not on an html file? You should let the desktop users go to your .com and redirect the mobile users. There are also other options out there for mobile sites.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 6 '10, 06:32 PM (#5)
aburningflame is offline
WDF Regular
 
aburningflame's Avatar
 
Join Date: December 2008
Posts: 477
aburningflame has a spectacular aura aboutaburningflame has a spectacular aura aboutaburningflame has a spectacular aura about
just rename your html file .php and make sure your host supports php...and your ready to use php! :O

you can also lookup 'javascript user agent redirect' or something to that matter if you want to use javascript to redirect (although im not sure all mobiles have javascript)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 6 '10, 08:04 PM (#6)
MadRukus is offline
WDF Member
 
MadRukus's Avatar
 
Join Date: January 2010
Posts: 51
MadRukus has a little shameless behaviour in the past
You will also need to put the include script inside a php tag also make sure you have uploaded the mobile detect php file if it's in a different directory then you need to change the path.

<?php include('mobile_device_detect.php');
$mobile = mobile_device_detect();
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  Web Design Forums » Programming Help » PHP

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Guestbook script needed! CrowChick PHP 3 October 30 '05 02:08 PM
Redirect Script troubles bnsonline PHP 7 August 19 '04 12:58 PM
this redirect script is kicking my butt Lucian PHP 3 November 5 '03 07:42 PM
PHP Script needed.... screenweb For Hire / Wanted 2 June 2 '03 07:34 PM

 
User Infomation
Your Avatar

Site Of The Month
Nominate Your Site Now!

Advertisement
WolfCMS.org

Latest Articles
- by RickM
- by bfsog

Advertisement

Partner Links



All times are GMT -4. The time now is 01:54 PM.


WebDesignForums.net is Copyright © 2010 RikeMedia.

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164