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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:59:22+00:00 2026-06-13T14:59:22+00:00

I am using MVC, specifically Codeigniter. I have a need to create a sub

  • 0

I am using MVC, specifically Codeigniter.

I have a need to create a sub domain on the service I am building. To pass a more “Mobile” friend version of the service to a user. Via m.example.com. Generally I would just add a virtual host, put everything in a folder, and so on and so forth, but since I am using MVC on this project most of the functionality lies in models and libs of which are agnostic to the view or even the controllers as far as the output they have.

So my current train of thought is that it would be a waste of resources to create a whole new folder on the machine that has the same exact stuff as the mvc currently in use has, just for the sake of using it as m.example.com. So I am wondering (cause it works this way currently with index.php) Is there a way to say I assume through htaccess that when traffic through m.example.com comes through, that I use a specific controller path, rather than a folder path? So that way just like its big brother index.php m.php (controller in this example) can handle all the core traffic and just have a bunch of functions that connect to the models, libs, etc..

In a comment I made below to someone, I said:

No, m.php is not in root, it’s a controller.. I am trying to route any
requests to m.example.com to the m.php controller (m.php is in the
controller directory, following suit with the MVC pattern), I can
access http://example.com/m/function/param/ following the MVC logic,
but I would like to have it so http://m.example.com/function/param/ is
equal to that of the mvc logic

Which ultimately means I am trying to come up with a logic either through .htaccess or some other means that http://example.com/m/function/param/ and http://m.example.com/function/param/ are the same exact thing, preferably without making a mirror copy of the entire CI installation and code I’ve built on to it, and putting it in a directory called m for example. I emphasize on this cause there seems to be some confusion.

  • 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-13T14:59:24+00:00Added an answer on June 13, 2026 at 2:59 pm

    You might want to take a look at this, and just alter it to use the HTTP_HOST instead of the user_agent library shown here

    http://digitizor.com/2011/12/05/codeigniter-mobile-browser/

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

Sidebar

Related Questions

I have been using telerik extensions for an asp.net mvc project, more specifically the
I'd like to implement MVC while using LINQ (specifically, LINQ-to-entities). The way I would
When using MVC, which controller should Terms of Service, Privacy, Help, About actions belong
Im using MVC-Viewmodel, EF Model first on my project. I have a foreach loop
I am using MVC 3 architecture in my project. I have a master page
I am using MVC C# along with Jquery. I have a partial view in
I have an ASP.NET MVC 3 site using a custom route for specifying the
I have a relatively simple ASP.net MVC 2 app that is using SubSonic. Everything
I'm using microsoft's MVC platform to create a web application. In this application, users
MVC @Html.TextBoxFor(model => model.SomeNotNullableType) When using this helper, if I have a type 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.