dotMobimobiThinkingmobiForgemobiReadyDeviceAtlasgoMobi

Posted by sucithra 2 years 46 weeks ago

pic
 sucithra
mobiForge Enthusiast
Posts: 13
Joined: 3 years ago
[offline]

Hi

i am using this condition for the mobile redirection in htaccess file

RewriteCond %{HTTP_HOST} ^www.desktop.com$
RewriteCond %{HTTP_ACCEPT} "text/vnd.wap.wml|application/vnd.wap.xhtml+xml" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windowssce|iemobile|mini|mmp" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp|ppc" [NC]
RewriteRule ^(.*) www.mobile.com [L,R=302]

when i enter the desktop site url (www.desktop.com)
in Macintosh Os (safari browser ) it direct to (www.mobile.com)

can anyone give me some solution for this...

thanks in advance

Posted by ruadhan 2 years ago

pic
 ruadhan
dotMobi logo
Mobile Champion
Posts: 710
Joined: 5 years ago
[offline]

If it is just happening for Safari on Mac OS then it you should be able to figure out the problem easily enough. Basically, the HTTP headers sent by Safari must be incorrectly matching to some of the rules you have here. So to figure out which rules they are matching, we just need to take a look at the headers that Safari is sending.

So, what version of Safari are you using? Have you checked what User Agent and Accept headers it is sending?

Ruadhan O'Donoghue
dotMobi

Posted by sucithra 2 years ago

pic
 sucithra
mobiForge Enthusiast
Posts: 13
Joined: 3 years ago
[offline]

hi

thank you..

the user agent is :

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; de-de) AppleWebKit/525.28.3 (KHTML, like Gecko) Version/3.2.3 Safari/525.28.3

i am not having the Mac os..i tested in the browsershort.org only..i got this useragent from the user who using the mac os with safari...

i removed the above code form my htaccess file.by that time also it show the mobile page.so the above code is not problem..

i think this is because of header problem like which you told..

so can you give me solution to this..

thanks in advance

Posted by sucithra 2 years ago

pic
 sucithra
mobiForge Enthusiast
Posts: 13
Joined: 3 years ago
[offline]

Hi ruadhan,

thank you.its fixed

in the below code: i remove the useragent :tosh then it works fine..
RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR]