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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:06:53+00:00 2026-05-24T18:06:53+00:00

Is there some where in Rails’s configuration where I can globally set the TLD

  • 0

Is there some where in Rails’s configuration where I can globally set the TLD length to 2 (co.uk as an example) so request.domain and request.subdomain parse correctly without having to pass options?

That is, request.domain(2), by default Rails seems to be set to 1 by default and it makes sense to be able to change this globally, however, haven’t been able to find anything in the documentation.

Does such a configuration option exist?

  • 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-24T18:06:54+00:00Added an answer on May 24, 2026 at 6:06 pm

    For Rails 3.0.9 and below, there’s no such configuration since the source of domain is:

    # File actionpack/lib/action_dispatch/http/url.rb, line 78
    def domain(tld_length = 1)
      return nil unless named_host?(host)
    
      host.split('.').last(1 + tld_length).join('.')
    end
    

    Source: http://apidock.com/rails/v3.0.9/ActionDispatch/Http/URL/domain

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

Sidebar

Related Questions

Is there some way to replicate rails' link-to-unless-current? Ie. if i have a list
Is there some plan or estimate about how long will Rails 2 be supported
Hi i am using rails and active record and there is some problem with
Is there some kind of software that I can feed uploaded images to and
Is there some event I can use to tell when the SelectedIndices property changes
Is there some regex that can be passed to re-seq such that it will
Is there some way to change Rails environments mid-way through a test? Or, alternately,
I want to access the file /public/images/dog.jpg in the Rails project. Is there some
I would like to know if there is some standard (Rails-version-independent) folder in Rails
Is there some way, any way to limit access to the rails asset pipeline

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.