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

  • Home
  • SEARCH
  • 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 8181991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:42:32+00:00 2026-06-07T00:42:32+00:00

I have tested out hundreds of different codes, either they work and screw something

  • 0

I have tested out hundreds of different codes, either they work and screw something else up, or they don’t work at all. This sounds lazy but I really have tried hundreds of combinations.

I have my main domain that I want redirected to my “mobile” sub domain (detecting mobile agent), and along with a folder of .html pages I have. Both directories match up file name wise.

Any ideas for me?

  • 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-06-07T00:42:33+00:00Added an answer on June 7, 2026 at 12:42 am

    Here is a website with information on how to redirect based on the browser’s user-agent string:

    http://www.howtoforge.com/apache2-how-to-redirect-users-to-mobile-or-normal-web-site-based-on-device-using-mod_rewrite

    Your .htaccess should look like so:

    RewriteEngine On
    
    # Check if this is the noredirect query string
    RewriteCond %{QUERY_STRING} (^|&)noredirect=true(&|$)
    # Set a cookie, and skip the next rule
    RewriteRule ^ - [CO=mredir:0:%{HTTP_HOST},S]
    
    # Check if this looks like a mobile device
    # (You could add another [OR] to the second one and add in what you
    #  had to check, but I believe most mobile devices should send at
    #  least one of these headers)
    RewriteCond %{HTTP:x-wap-profile} !^$ [OR]
    RewriteCond %{HTTP:Profile}       !^$
    # Check if we're not already on the mobile site
    RewriteCond %{HTTP_HOST}          !^mobile\.
    # Check to make sure we haven't set the cookie before
    RewriteCond %{HTTP:Cookie}        !\smredir=0(;|$)
    # Now redirect to the mobile site
    RewriteRule ^ http://mobile.jguffphotography.com/%{REQUEST_URI} [R,L]
    

    Make sure you update to the latest code above.

    I have updated all of the code above to reflect what is should look like.

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

Sidebar

Related Questions

This is a weird bug that I can't figure out because I have tested
I have tested this servlet and it works well, except in Google Chrome it
How to make CITE tag entirely indented? I have tested all of the padding-left:
I have tested this on my development computer, but now I have uploaded everything
I have this very annoying problem I cannot figure out. This is the main
I have just started learning about Java server faces and successfully tested out my
I have a script that works fine in all browsers that I have tested
I have an app out which displays this link in a web view when
I have tested my all viewControllers dealloc methods. And all of them getting called
I have tested the below script on a demo page which is not using

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.