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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:14:29+00:00 2026-05-23T07:14:29+00:00

Several different domains names point to my app on heroku, for example foo.com and

  • 0

Several different domains names point to my app on heroku, for example foo.com and bar.com both point to the app. (We host specialized blog pages, and foo.com is the domain used by our Users who are creating web pages, and bar.com is the ‘public facing’ domain where the blog pages are.)

All the user-editing pages have Devise authentication, and the “root” on foo.com is the User’s dashboard page. And a logged-in user can preview their blog page at foo.com/reviewpage/USERID

each User acount also has a unique “friendly url name” such as “acme-inc-dallas-tx”

On the public-facing web page bar.com (but ONLY this one domain), I need to somehow map

http://bar.com/friendly-url-name to :controller => mycontroller, :action => myaction

I assume that means I need to re-map ‘root’ on bar.com (but ONLY bar.com) to a method “find_friendly_url” that looks up the appropriate page and displays it.

If that is the right way to proceed… how would I remap ‘root’ for one and only one domain that points to my app?

  • 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-23T07:14:29+00:00Added an answer on May 23, 2026 at 7:14 am

    I usually proceed as follows:

    constraints(Subdomain) do
      match "/" => "home#admin"
    end
    
    match "/" => "home#standard" 
    

    Or:

    match "/" => "home#admin", :constraints => {:subdomain => "admin"}
    
    match "/" => "home#standard" 
    

    Which creates:

    /(.:format) {:action=>"admin", :subdomain=>"admin", :controller=>"home"}
    root  /(.:format) {:action=>"standard", :controller=>"home"}
    

    The same logic lets you create routes only available to desired subdomains.

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

Sidebar

Related Questions

I have several sites in different domains: example.com , example.org , mail.example.com and passport.example.org
We have several websites on different domains and I'd like to be able to
There are several different methods for converting floating point numbers to Integers in JavaScript.
My console .NET application has several app domains. My wish is simple - console
I want to point several domain names to the same Rails application. The content
I work on a WebKit-based app that runs several different web apps for a
I have several different c# worker applications that run various continuous tasks: sending emails
Background There are several different debug flags you can use with the Visual Studio
We have several different optimization algorithms that produce a different result for each run.
I have used several different scripts that people have suggested for trying to parse

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.