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

The Archive Base Latest Questions

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

I was recently tasked with segregating my existing Rails 3 application into a standard

  • 0

I was recently tasked with segregating my existing Rails 3 application into a standard and premium version. The premium version will have all the existing functionality with the addtion of a new layout, and new functionality. Ideally I want premuim users to access this site byway of prefixing the current url with a subdomain, e.g, “premium.somesite.com”/ The standard version of the website I don’t want to change and is still accessible by the default url.

If possible I would like to simply add some logic to exiting views and controller to determine how the request is treated on whether or not a subdomain is being used .

I tried following the Railcast subdomains in rails 3, however he’s using subdomains in context of a blog model and database attributes where as I wanted mine to be application-wide. Is this even possible with subdomains? How can I get started?


What I’ve tried:

Added an additional VirtualHost to my apache httpd.conf file used by passenger:

<VirtualHost *:80>
  ServerName premium.mydomain.com
  DocumentRoot /somewhere/../myapp
  <Directory /somewhere/public>
    Allow from all
    Options -Multiviews
  </Directory>
</VirtualHost>

Added the following to my routes.rb

class PremiumSubdomain
  def self.matches?(request)
    request.subdomain == "premium"
  end
end

MyApp::Application.routes.draw do    
  constraints(PremiumSubdomain) do    
    #all of my routes...    
  end    
end

What happens:

Trying to navigate to my site with the premium subdomain results in a domain not found, adding the constraint to my route.rb prevents the rest of the application from rendering anything on my default url.

  • 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-13T18:34:24+00:00Added an answer on June 13, 2026 at 6:34 pm

    So it turned out that while I did have everything configured on apache appropriately we were using a third-party for our DNS server so it was simply a matter of adding a record for our sub-domain and everything else was peachy.

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

Sidebar

Related Questions

We have an application that performs auto-updates. Until recently, we haven't run into any
I have recently been tasked with upgrading an application from .net 1.1 to 3.5
Recently I have been tasked with creating an application for a business that basically
I've run into a problem recently, hoping you all could help. I was tasked
I've started work recently at a new company and they have an existing application
I don't have much experience with Serial I/O, but have recently been tasked with
Recently I have released my app into the US AppStore. Now I Planed for
I was recently tasked with optimizing some existing Oracle stored procedures. Each of the
I was recently tasked with upgrading a classic ASP web application to C#. Everything
I was recently tasked on implementing a buffer which will be used as a

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.