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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:23:22+00:00 2026-05-22T00:23:22+00:00

I have a web app of which I would like to create a mobile

  • 0

I have a web app of which I would like to create a mobile version with jQuery Mobile. The existing application is built in CodeIgniter; I’ll be using the same controllers, models where I can; (especially models since I’ll be needing the same data anyway, might have to write new controllers).

I’m a bit confused as to how to get started. I want to put my mobile version on a subdomain (m.myhost.tld), however.. since my app is at www.myhost.tld and I don’t feel like copying it all over to another folder and maintain two, I’m a bit confused.

I know I can use the User Agent library in CodeIgniter to detect mobile browsers and load views accordingly; I just don’t know how to get this working with a subdomain. Do I need to customize my app/config/routes.php file here, or can I fix this with some .htaccess magic? I have next to none experience with .htaccess though. The only thing I know is how to remove my index.php from CI apps, and that’s a copypasta snippet.

EDIT: I wonder if I can use a tutorial like this one to do what I want to do? It seems to be doing more or less the same thing, just with dynamic usernames instead of a simple ‘m.’

EDIT 2: Some more information, I guess.

Say I detect mobile browsers using the User Agent library included with CodeIgniter. I want to direct these browsers to m.myhost.tld. However, the content that I want to display on the mobile website comes from a controller called mobile which I can also access through www.myhost.tld/mobile/; so my question is if there is a way to route a URL like.. for example www.myhost.tld/mobile/about to m.myhost.tld/about. I’m not even sure if this is possible, teehee. Still learning!

I’ll be grateful for any advice you can give me. Thanks a lot!

  • 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-22T00:23:23+00:00Added an answer on May 22, 2026 at 12:23 am

    If you want to share the same files in different hosts, you must assign the document root folder of your sites in your web server, this is an explanation for static files, but is the base to you understand.

    browser -> host:z.y.xxx[ip.ip.ip.ip] -> web server -> read filesystem : document root + browser request path

    so if your document root is:

    /hosting/http/z.y.xxx/htdocs
    

    and the request is /path-to-static/index.html the server try to read:

    /hosting/http/z.y.xxx/htdocs/path-to-static/index.html
    

    In conclution, you create the new host m.mysite.tld in your web server and you change the document root as the same of the you http://www.mysite.tld also you could use directives of host alias, like Apache ServerAlias directive. Have lot of documentation to how you could configure a web server.

    You could handle the host name in php with $_SERVER['HTTP_HOST'] variable.

    If you could specify more, I could help more.

    have a nice day

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

Sidebar

Related Questions

I have an ASP.NET(2.0 using C#) web app, in which I have a gridview.
I have built a web setup project in VS2008 which installs my ASP.NET/Silverlight app
I would like to create a web app similar to Stack Overflow in that
I am building a web application in which I would like to include the
I have a web app which lets the user select the excel spreadsheet and
I have a Flash web app which displays user submitted PNG files. Files are
I have a Silverlight web app which uses ASP.net Website administration tool for user
Have an ASP.net web app which works fine for a few days, but then
The thing I have a web app (asp.net) which needs to have a feed.
I have a user profile page on my web app which has contact information.

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.