Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

Mobile Site


  • Please log in to reply
4 replies to this topic

#1 madams

madams

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 504 posts
  • Location:Costa Blanca, Spain

Posted 18 March 2009 - 01:46 PM

Hi

I have made a mobile site and put the files in ...mysite/mobile/

What is the procedure to automatically direct someone who accesses my normal site (via mobile device), to the mobile site.

Thanks in advance

#2 madams

madams

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 504 posts
  • Location:Costa Blanca, Spain

Posted 19 March 2009 - 11:43 AM

Ok, Ive done some research and found this on creativecow.net...

.htaccess
CODE
Options -Indexes
XBitHack On
AddType text/html .htm
AddHandler server-parsed .htm
Options +FollowSymlinks
RewriteBase /
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} Windows\ CE [NC,OR]
RewriteCond %{HTTP_USER_AGENT} BlackBerry [NC,OR]
RewriteCond %{HTTP_USER_AGENT} NetFront [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Opera\ Mini [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Palm\ OS [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Blazer [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Elaine [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WAP.*$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Plucker [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Nokia [NC,OR]
RewriteCond %{HTTP_USER_AGENT} AvantGo [NC]
RewriteCond $1 !^mobi
RewriteRule ^(.*)$ /mobi/$1 [L]
RewriteCond %{http_host} ^mysite.com [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]


Does this look ok to you coders?
It includes a redirect (at the bottom) from a non www. site to a www. one.

In my .htaccess file I only have the www. redirect, so I am tempted to give it a try changing "mysite.com" to my site name and "mobi" to the folder with my mobile site files are kept.

Is there code missing? or is it ready to go!

Sorry to be a pain but I don't want to damage anything wacko.gif



#3 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 19 March 2009 - 11:53 AM

It looks fine to me Madams. Basically it's keying in on the browser user-agent string, sending the mobile users off to their own little area. So as long as your mobile area contains everything they need to get to you should be fine.

That said, I'd probably still want to make sure a "Mobile" link to this area appears somewhere on the main site. Just in case someone comes in with a mobile unit using a different browser.

I've not gotten to much into Mobile stuff because my current sites just don't lend themselves to mobile users easily, but I understand there are some other mobile user-agents seen in smaller numbers out there in the wild. Off of the top of my head, additions to your list might be: SonyEricsson, Smartphone, MMP, LG, RIM, Xiino and Samsung. All of those will be small number to my understanding, but you'd still want to give every mobile user the chance to get to the version most appropriate for them.

#4 madams

madams

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 504 posts
  • Location:Costa Blanca, Spain

Posted 19 March 2009 - 12:05 PM

Thanks Randy

QUOTE
I understand there are some other mobile user-agents seen in smaller numbers out there in the wild. Off of the top of my head, additions to your list might be: SonyEricsson, Smartphone, MMP, LG, RIM, Xiino and Samsung


To cover all possible user agents are you saying I just add the new agent to a new line of code? (below)

i.e. change "Nokia" to the new agent, when I come across them?

CODE
RewriteCond %{HTTP_USER_AGENT} Nokia [NC,OR]




#5 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 19 March 2009 - 12:28 PM

Right. But the problem is you're probably never going to get them all. Not unless you're willing to spend some time each month to look for any new mobile user agents or the proxies they come through.

As another option, if you happen to use php or some other type of scripting on your site's pages I know I've run across scripts and classes out there where the detection and redirect happens at the file/script level rather than at the server/.htaccess level. So if you had a php site and happened to use a dynamic header that gets called into each page of the main site it would be pretty simple to implement.

I don't know how well those are supported, but one would hope someone is keeping on top of new mobile devices if they're going to the trouble of releasing a script or class.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

We are now a read-only forum.
 
No new posts or registrations allowed.