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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:44:37+00:00 2026-06-10T23:44:37+00:00

Update: rewritten question a bit. Trying to route my subdomains like below login.app.ltd user1.app.ltd

  • 0

Update: rewritten question a bit. Trying to route my subdomains like below

  • login.app.ltd
  • user1.app.ltd
  • user2.app.ltd
  • signup.app.ltd

Using

  • Rails 3.2
  • Devise

To no avail tried several tutorials blog posts, anyone knows a working example for this?
Really stuck on this 🙁

this is my routes now:

 match '', to: 'frontend#index', constraints: lambda { |r| r.subdomain.present? && ( r.subdomain != 'www') }
  #match '' => 'home#index', :constraints => { :subdomain => 'login' }


  constraints :subdomain => /^(?!signup\b)(\w+)/ do
    root :to => "frontend#index"
  end

  root :to => "frontend#index"
  • 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-10T23:44:39+00:00Added an answer on June 10, 2026 at 11:44 pm

    My RailsApps project offers a complete example app showing how to use subdomains:

    Rails Tutorial for Subdomains with Devise

    Did you take a look at that?

    config/routes.rb

    devise_for :users
    resources :users, :only => :show
    constraints(Subdomain) do
      match '/' => 'profiles#show'
    end
    root :to => "home#index"
    

    lib/subdomain.rb

    class Subdomain
      def self.matches?(request)
        case request.subdomain
        when 'www', '', nil
          false
        else
          true
        end
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'll like to update the following rewrite condition to only allow one particular subdomain.
Update: Is there a way to achieve what I'm trying to do in an
UPDATE: I've been playing around with this more, and it seems like tmux's clear-history
Ok this maybe sound like the worst question on stackoverflow but here it is.
(This question has been rewritten from an issue with NSTextView following some further research)
Sorry for constantly re-editing my question but looks like this is the only way
Update2 I've rewritten the entire question, because some things became a lot clearer, the
a short question about optional regex : imagine a given page thats currently rewritten/beautified
NOTE: Updated and rewritten This question has been redone and updated. Please pardon outdated
UPDATE I tried using the internal wordpress rewrite. What I have to do is

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.