Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4534606
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:18:06+00:00 2026-05-21T14:18:06+00:00

I have a mobile site and it has just started a service for desktop

  • 0

I have a mobile site and it has just started a service for desktop users also. How do I use .htaccess to redirect users using the desktop to the desktop version of the site?

I have tried simple PHP scripts to redirect to the home page of the desktop version, but I would like the redirect to be slightly more efficient. For example, I would like to redirect http://site.com/subfolder/ to http://site.com/desktop/subfolder/, and I figured that using .htaccess might be able to get the job done.

I have tried the following and it doesn’t seem to work.

RewriteCond %{REQUEST_URI} !^/desktop/.*$
RewriteCond %{HTTP_USER_AGENT} "!android|!blackberry|!ipad|!iphone|!ipod|!iemobile|!webos|!googlebot-mobile" [NC]
RewriteRule ^(.*)$ /desktop/ [L,R=302]

Please help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T14:18:07+00:00Added an answer on May 21, 2026 at 2:18 pm

    Try these rules in your .htaccess file:

    RewriteEngine on
    Options +FollowSymlinks -MultiViews
    RewriteCond %{REQUEST_URI} !^/desktop/ [NC]
    RewriteCond %{HTTP_USER_AGENT} ^.*(MSIE.*Windows\ NT|Lynx|Safari|Opera|Firefox|Konqueror) [NC]
    RewriteCond %{HTTP_USER_AGENT} !(^.*(Opera\ Mini|SymbianOS|Mobile)) [NC]
    RewriteRule ^(.*)$ /desktop/$1 [L,R=302,NC]
    

    Update (combined with wordpress rules)

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    Options +FollowSymlinks -MultiViews
    
    RewriteCond %{THE_REQUEST} !^GET\s/wp-login\.php [NC]
    RewriteCond %{REQUEST_URI} !^/(desktop/|wp-admin/|wp-login\.php) [NC]
    RewriteCond %{HTTP_USER_AGENT} ^.*(MSIE.*Windows\ NT|Lynx|Safari|Opera|Firefox|Konqueror) [NC]
    RewriteCond %{HTTP_USER_AGENT} !(^.*(Opera\ Mini|SymbianOS|Mobile)) [NC]
    RewriteRule ^(.*)$ /desktop/$1 [L,R=302,NC]
    
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(desktop/|wp-admin/|wp-login\.php) [NC]
    RewriteRule . /index.php [L]
    
    </IfModule>
    # END WordPress
    

    R=302 will redirect with https status 302

    L will make last rule

    NE is for no escaping query string

    $1 is your REQUEST_URI

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mobile site and I'd like to redirect users to the domain.mobi
Has anyone ran into this issue? We have a mobile site that can't use
I have created a mobile version of my website using jquery mobile. My site
I have a public desktop site, a public mobile site, and a private intranet
I am developing a site for mob using jquery mobile. I have a content
I have simple jQuery Mobile site created using asp.net mvc 2 and uses basic
I have created a web page using JQuery Mobile that has a link at
We've recently started a small-ish project for a mobile site demo w/.NET4; jquery-mobile has
I am developing a mobile site which has multiple divs. I have validator set
i have a page for a small mobile site that has an image that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.