SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict aguroyz's Avatar
    Join Date
    Jan 2009
    Location
    Konoha Fire Country
    Posts
    311
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help in HTACCESS redirect

    Hi,


    How can I achieve this in HTACCESS.. What I want is that if a user is using a Smartphone device and access the link http://luxury.localhost/others/mypage.html he will be redirected to http://luxury.localhost/sp/entry but if he is just using a PC he will be redirected to http://luxury.localhost/entry page..


    Code:
    Code:
    #the logic is something like this
    # If using smartphone
    RedirectMatch /others/mypage.html /sp/entry/
    
    
    #else if using PC
    RedirectMatch /others/mypage.html /entry/
    PLease help me.


    Thanks
    Uniquely FILIPINO... See how talented and creative Filipinos are.
    http://www.smalltym.com
    Custom Web Designs:
    http://proweaver.com

  2. #2
    SitePoint Wizard webcosmo's Avatar
    Join Date
    Oct 2007
    Location
    Boston, MA
    Posts
    1,480
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    RewriteCond %{HTTP_USER_AGENT} "(android|blackberry|googlebot-mobile|iemobile|iphone|ipod|opera mobile|palmos|webos)" [NC]
    RewriteRule your redirect ,
    else ... is for PC and mac, etc. It`s all about user agent.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •