PDA

View Full Version : Mobile Site Re-diversion



spyder
09-09-2013, 04:03 PM
Hi, I'm completely pulling my hair out with this one..

I've got two websites:
www.idriveacademy.co.uk
and
idriveacademy.mobi

I'm using the .mobi version for the obvious of making it simple to read on mobile phones.

I've tried using the following code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>

# END WordPress

Options +FollowSymlinks
RewriteEngine on
RewriteBase /

# prevent looping
RewriteCond %{HTTP_HOST} !^idriveacademy.mobi$

# if the browser accepts these mime-types, it's definitely mobile, or pretending to be
RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC,OR]

# a bunch of user agent tests
RewriteCond %{HTTP_USER_AGENT} "****|symbian|*****|*******|mobile|windows ce|epoc|opera" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "mini|nitro|j2me|midp-|cldc-|netfront|mot|up\.browser|up\.link|audiovox"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "blackberry|********,|*********|philips|sanyo|***** |sie-"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "portalmmm|blazer|avantgo|danger|****|series60|**** source|pocketpc"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "smartphone|rover|ipaq|au-mic,|*******|ericy|vodafone\/|wap1\.|wap2\.|******|android"[NC]

# rewrite rules here
RewriteRule ^(.+)\$ http://www.idriveacademy.mobi/$1 [R=302,NC]


some questions..
1) where do i put the code
2) Have I missed anything ?
3) does it matter if the .index pages are HTML or .PHP for both websites ?

sorry if this sounds like a newbie question but there's very little easy help on this subject

spyder
09-09-2013, 04:30 PM
Just read thru another post..
http://www.vodahost.com/vodatalk/bluevoda-tips-tricks-shortcuts/59605-create-mobi-webs-blue-voda.html

Apparently making it simple for mobile phone detect and divert.. mmmm

OK, i've downlaoded the Mobile Device Detector and i'll quote

"5. And, you mustn't forget to use the all-important Mobile Device Detection Script which when installed on your .com/.org/.info/.biz website can detect if a Visitor is using a mobile device (telephone) and then automatically "forward" them seamlessly to your specially prepared .mobi site: Use this simple Java based "DnD" (Detect and Direct) code > http://code.google.com/p/mobiledevic...or-0.1-src.zip (http://code.google.com/p/mobiledevicedetector/downloads/detail?name=MobileDeviceDetector-0.1-src.zip)"

Downloaded the file.. can only find the file thats related : MobileDeviceDetector\src\java\mob
the script is in there, but no easy way of telling which website is going to divert to (.mobi)

Or am i missing something
And where does this script go into ?

Vasili
09-09-2013, 10:20 PM
Read the ".txt" file that is included for installation instructions, as well as the documentation on the actual Download page. You must simply modify the script to show your specific MOBI site.
And, there are expanded instructions in the Google Developer pages that preface this download.

Nothing was promised as "easy" .... only effective and precisely what is required. I myself used it successfully on 3 sites more years ago, but have since forgotten specifically the steps I used. You might have to do a Google Search on your own to find instructions you can use.

spyder
09-10-2013, 09:36 AM
Finally got it working... its more simple than I thought..
Here's the steps I used:

1) goto the the Blue FTP (Tools FTP Manager)
2) Locate the root folder and look for a file .htaccess and copy the file onto your pc/voda folder
3) Edit the the file using wordpad/notepad etc
4) Goto http://wordpress.org/support/topic/how-to-redirect-links-for-mobile-using-htaccess
5) Copy and the TOP script, (the second script doesn't work for some reason)
6) Edit the following:
# prevent looping RewriteCond %{HTTP_HOST} !^m.mysite.com$

and:

# rewrite rules here
RewriteRule .? http://m.mysite.com%{REQUEST_URI} [L,R=302]

remember if your using a .mobi version to include the full http://www.mobilesite.co.uk (.com/.net etc)
** do not delete any of the $ or ? [spaces] characters etc

4) Save the file with the new edited script
(recommend you leave a carriage (return) between the new script and anything else underneath it
5) Delete the old .htaccess script in the root of the folder
6) Copy the new script over into the root of the folder
7) Works a treat


If you find it doesn't work copy the original script at the above link without editing anything, this should divert to mysite.com
then edit your the text with mysite text
remember you need to copy the old .htaccess file over, edit it, save it and delete the old one in the root of the folder
everytime you edit it.
There's less margin for error.

Hope this helps any other newbie's lol Thanks again, Vasili. The scripts rocks!