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 7959455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:34:35+00:00 2026-06-04T04:34:35+00:00

I need to rewrite a url so that it adds a url variable to

  • 0

I need to rewrite a url so that it adds a url variable to all requests to the a sub-domain.

Example:

m.mydomain.com ==> m.mydomain.com?mobileFormat=true

This is the flag that triggers the mobile version of my site to load.

Should be easy right? Everything I have tried so far isn’t working.

Here is the code I currently have in my .htaccess file:

   RewriteEngine On
   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
   RewriteRule ^([a-zA-Z0-9/-]+)$ /index.cfm%{REQUEST_URI} [PT]

   RewriteRule ^locale/([^/]*)$ /?siteLocale=$1 [L]

   RewriteCond %{HTTP_HOST} ^m\.(.*)$
   RewriteRule ^(.*)$  m.%1/$1?mobileFormat=true [QSA]

Thanks for the 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-06-04T04:34:35+00:00Added an answer on June 4, 2026 at 4:34 am

    The solution I was looking for was:

    RewriteCond %{HTTP_HOST} ^m\.(.*)$ [NC]
    RewriteCond %{REQUEST_URI} !\.(xml|jpg|gif|png|js|css)$
    RewriteRule .? $1?mobileFormat=true [QSA,L]
    

    Thanks for all of the help.

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

Sidebar

Related Questions

I need to rewrite any url on my domain that starts with **/club/***anyPage* to
I need rewrite this url http://adresa.com/article.php?act=view&id=1113 to http://adresa.com/view/1113 I make it with mod_rewrite in
I am wanting to rewrite a url like: http://my.project/mydomain.com/ANY_NUMBER_OF_CATEGORIES/designer/4/designer-name/page.html to this: http://my.projects/mydomain.com/ANY_NUMBER_OF_CATEGORIES/page.html?designer=4 I would
All the advice online says do: rewrite 301 URL-A URL-B But that won't work
I need to rewrite a url that contains a comma to another URL. The
I have a url that is easily accessible when you request it as: http://example.com/2005/01/example.html
I need to write a URL Rewrite rule for my IIS 7.5 website that
Given a URL rewrite rule like the following: <rule name=RewriteUserFriendlyThings stopProcessing=true> <match url=^cat/sub-cat/(\d+)/([^/]+)/?$ />
I'm trying to rewrite an url from: http://domain.com/aa/whatever/whatever.php to http://domain.com/whatever/whatever.php?language=aa However, depending on existing
i have a mixed aspx/MVC webapp project and need to rewrite incoming URL's either

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.