![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jun 2011
Posts: 266
|
Mobile redirect code
How would you go about having a mobile visitor go to a page linked from a referring site and display page as normal . If the surfer clicks on any of the site navigation bars/pages etc after this would get redirected if mobile?
Thanks for any thoughts on this! |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Aug 2012
Location: Europe
Posts: 115
|
do you need a code?
Code:
<script type="text/javascript"> if (navigator.userAgent.match(/(opera mini|samsung|ipod|ipad|iphone|up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|psp|treo|nokia|blackberry|pre\/0.1|android)/i)) { location.replace("URL for redirect HERE"); } </script> |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#3 |
Useless As Ever
Industry Role:
Join Date: Jan 2009
Location: Planet Earth
Posts: 731
|
Oops, wrong answer....edited
You want them to land on your normal page first. Then when they click anything, they get redirected to mobile? Why not redirect them coming in?
__________________
Email: admin[at]datingport.co.uk - ICQ: 456416181 It's amazing what you (L)earn when you put some effort into it! |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Jun 2011
Posts: 266
|
One of those image hosting sites. Want them to see the gallery image when they come in through a external link but redirect if they do any actions
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#5 | |
Useless As Ever
Industry Role:
Join Date: Jan 2009
Location: Planet Earth
Posts: 731
|
Put this between your <head> </head> tags
Quote:
I just tested it on a page that had an image but no links or urls.
__________________
Email: admin[at]datingport.co.uk - ICQ: 456416181 It's amazing what you (L)earn when you put some effort into it! |
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#6 |
Registered User
Join Date: Apr 2008
Posts: 35
|
If you want an alternative, you could use PHP on all the other pages, like this:
Edit: I can't post links, but if you google 'php if mobile device' the google codes reuslt seems optimal. |
![]() |
![]() ![]() ![]() ![]() |