1
Anonymous
Is a redirect to mobile site possible?
  • 2011/1/29 11:47

  • Anonymous

  • Posts: 0

  • Since:


Beside a main xoops site I have build a new mobile version (using wapple). The main site is http://www.molenbataaf.nl , the mobile version can be found at m.molenbataaf.nl .

I would like to redirect all mobile users from the xoops site to the mobile one. Can this be achieved in an automatic way?

2
xoobaru
Re: Is a redirect to mobile site possible?
  • 2011/1/29 12:39

  • xoobaru

  • Just can't stay away

  • Posts: 494

  • Since: 2010/12/2


You could probably do it at the dns zone mapping level, create an A record assigning the m zone of your domain to the IP address of your mobile site.

3
Anonymous
Re: Is a redirect to mobile site possible?
  • 2011/1/29 12:46

  • Anonymous

  • Posts: 0

  • Since:


That's not my question noobaru, redirecting the m zone to the wapple site works fine allready.

I want all mobile visitors to the www site being redirected to the m zone.

Does anybody have experience with this script http://detectmobilebrowsers.mobi . Will it work and is there a possibility to hack xoops index.php for using the script?

4
Anonymous
Re: Is a redirect to mobile site possible?
  • 2011/1/29 13:04

  • Anonymous

  • Posts: 0

  • Since:


I have put the script in index.php and it looks like it is working, that is with my android phone.

I wonder if it will work with Iphones and other brand phones. Who's willing to test and give me feedback? By entering http://www.molenbataaf.nl as destination, you should be redirected to m.molenbataaf.nl I can't wait for hearing the results. Thank you in advance !


5
zyspec
Re: Is a redirect to mobile site possible?
  • 2011/1/29 16:47

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


flipse,

Works on Blackberry Bold from USA...

6
Bleekk
Re: Is a redirect to mobile site possible?
  • 2011/1/29 19:05

  • Bleekk

  • Theme Designer

  • Posts: 941

  • Since: 2002/12/14


works with win phone 7

7
Anonymous
Re: Is a redirect to mobile site possible?
  • 2011/1/29 20:35

  • Anonymous

  • Posts: 0

  • Since:


Thank you both for testing. For now it looks like this script works well.

The possibility to redirect mobile users to an external site would be a nice feature to put in xoops. As I found out building a dedicated mobile site is the way to go with static websites without to much changes in content or news. A mobile module like xobile is nice but lacks potential to build a realy nice mobile site.

8
xoobaru
Re: Is a redirect to mobile site possible?
  • 2011/1/29 20:59

  • xoobaru

  • Just can't stay away

  • Posts: 494

  • Since: 2010/12/2


There is no doubt that the convenience of mobile access to your site will drive up visits. I intend to make that move myself so I have an interest too. If unique mobile user agents exist, try filtering for mobile status by user agent and if true do a conditional php redirect to the m zone. If false pass through to the www zone.

The URL shows an example of such a usage, but not sure where you would find a database of mobile user agents (there has to be alot) or what they look like.

http://www.tutorialized.com/view/tutorial/PHP-Redirect-Tutorial/40894

Also bear in mind that if you use SEO, the search engine friendly (301) redirect usage would be optimal. You can test your redirect for this here

http://www.webconfs.com/redirect-check.php




9
trabis
Re: Is a redirect to mobile site possible?
  • 2011/2/9 14:12

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


I'm using ZEND:
http://framework.zend.com/manual/1.11/en/zend.http.user-agent.html

It has an adapter class based on this script:
http://wurfl.sourceforge.net/

You can get the type of the user agent like this:
$bootstrap Zend_Controller_Front::getInstance()->getParam('bootstrap');
        
$userAgent $bootstrap->getResource('useragent');
        
$deviceType $userAgent->getDevice()->getType();
        
$bootstrap->getResource('layout')->setLayout($deviceType);


$deviceType will hold 'mobile' or 'desktop'. In this example user will see mobile.phtml or desktop.phtml depending on the devide they are using.

Great thing is that Xoops 3.0 is using Zend!



Login

Who's Online

327 user(s) are online (198 user(s) are browsing Support Forums)


Members: 0


Guests: 327


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits