+ Reply to Thread
Results 1 to 5 of 5

Thread: How to make a redirection for mobile browsers ??

  1. #1

    Lightbulb How to make a redirection for mobile browsers ??

    hello everybody


    How to make a redirection for mobile browsers to i another home page !

    pc to > index.html

    mobile > index2.html

    thinks team

  2. #2
    Senior Member
    Join Date
    Nov 2016
    Location
    USA
    Posts
    110
    Try this solution


    .htaccess URL rewrite redirects

    You can use a .htaccess redirect to transfer visitors based upon the MIME types the browser supports. For example, if the user's browser accepts mime types that include WML (Wireless Markup Language), then most likely it is a mobile device.

    The code below should be placed in your .htaccess file:

    RewriteEngine On
    # Check for mime types commonly accepted by mobile devices
    RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC]
    RewriteCond %{REQUEST_URI} ^/$
    RewriteRule ^ http://m.domain.com%{REQUEST_URI} [R,L]

  3. #3
    Hello Samir Fakirani , thanks a lot for your help

    Your proposed solution did not work !


    I plucked all my hair to find the solution


    RewriteEngine on



    RewriteCond %{QUERY_STRING} !^desktop
    RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|iphone|ipod|#opera mobile|palmos|webos" [NC]
    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|m mp" [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC]
    RewriteRule ^$ http://www.domain.com/page_mobile.php [L,R=302]


  4. #4
    Senior Member
    Join Date
    Nov 2016
    Location
    USA
    Posts
    110
    Glad you had this figured out, do you mind asking why you need two separate home pages for desktop and mobile, all the templates are responsive.

  5. #5
    Quote Originally Posted by Samir Fakirane View Post
    Glad you had this figured out, do you mind asking why you need two separate home pages for desktop and mobile, all the templates are responsive.

    My site is based on two home page the first page is ( homepage ) /index.html (static) and the second and /index.php (dynamic page of the script of the Flynax script)


    Page 1 /index.html (static) and bassed on the computer's display


    I find the right way for me


    My greetings

+ Reply to Thread