Masaüstü ve Laptoptan Mobil Siteye Girenleri Htaccess ile Ana Siteye Nasıl Yönlendiririm?
4
●934
- 02-04-2015, 18:33:06Üyeliği durdurulduMobil site özel bir script mi yoksa asıl sitenin responsive hali mi?Erkan1 adlı üyeden alıntı: mesajı görüntüle
Yani mobil site m.siteadresi.com mu? - 03-04-2015, 04:36:05Mobil site farklı script Hocam m.siteadresi.com şeklinde...destinatrade adlı üyeden alıntı: mesajı görüntüle
- 03-04-2015, 11:21:06htaccess yerine mobiledetect php kullanmanızı tavsiye ederim
RewriteEngine on RewriteBase / # yonlendirmeme sorgusu mu diye kontrol RewriteCond %{QUERY_STRING} (^|&)m=0(&|$) # cookie belirleyip sonraki kuralı atla // siteadresi kismini degistir RewriteRule ^ - [CO=mredir:0:www.siteadresi.com] # mobil cihaz kontrolu # (başka [OR] şartları ekleyerek kontrolü genişletebilirsiniz) RewriteCond %{HTTP:x-wap-profile} !^$ [OR] RewriteCond %{HTTP:Profile} !^$ [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" [NC] RewriteCond %{HTTP_USER_AGENT} !macintosh [NC] # zaten mobil sitede miyiz kontrolü RewriteCond %{HTTP_HOST} !^m\. # aynı sorguda hem cookie okuyup hem yazamayiz RewriteCond %{QUERY_STRING} !(^|&)m=0(&|$) # daha önce cookie tanımlamadığımızda emin oluyoruz RewriteCond %{HTTP_COOKIE} !^.*mredir=0.*$ [NC] # ve son olarak mobil siteye yönlendiriyoruz // siteadresi kismini degistir RewriteRule ^ http://m.siteadresi.com [R,L]