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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:56:05+00:00 2026-06-08T20:56:05+00:00

When I access to http://testuser.example.com , I’d like it to access to ‘user’ controller’s

  • 0

When I access to http://testuser.example.com,
I’d like it to access to ‘user’ controller’s ‘show’ action with the parameter ‘testuser’, which is user name in user Model.

How can I archive this easily??

  • 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-08T20:56:07+00:00Added an answer on June 8, 2026 at 8:56 pm

    This should work

    @user = User.find_by_name(request.subdomain)
    

    update

    for routes

    constraints(:subdomain => /.+/) do
      root :to => 'user#show'
    end
    

    simply you define new routing rules when subdomain exists, you can change it according to your needs.

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

Sidebar

Related Questions

I want to redirect users trying to access http://example.com/car/ to http://example.com/car/blue/ in .htaccess I
if I use Firefox and access http://svcs.ebay.com/services/search/FindingService/v1 I get some sort of XML in
I purchased a domain: josecvega.com Whenever someone tries to access http://www.josecvega.com it forwards them
I'm trying to access the http://s3.amazonaws.com/commoncrawl/parse-output/segment/ bucket with boto. I can't figure out how
I only need a JQuery UI Tabs, so I access http://jqueryui.com/download and only select
I am having some troubles with my script.. when I access http://www.domain.com/this-is-a-topic I want
I am trying to access http://graph.facebook.com/{user_id} . It usually returns all the public information
I have a Facebook page feed that I want to access: http://facebook.com/feeds/page.php?format=json&id=123456789 (Not a
When I access http://www.my_url.com/index.jsp I get the updated web page, but when I'm trying
I am trying to access http://services-staging.cmtnyc.com/payment/payment.asmx web service and AuthorizeCreditTrip I checked this webservice

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.