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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:46:41+00:00 2026-05-21T20:46:41+00:00

I have some no so easy routing design issues with rails 3. We have

  • 0

I have some no so easy routing design issues with rails 3.

We have a website translated in several languages. Some of this languages have a full domain support like :

example.com -> english
example.es -> spanish
example.fr -> french
exemple.de -> german
... (lot more)

But we have also :

example.com/zh-hans -> chinese
example.com/ru -> russian
... (lot more)

I am aware with the constrains feature (to matches? with request.host) but I have a lot of problems figuring out how to make the routing system works well with the both type of urls.

Everything broke as soon as we have two different type of requests :

host:example.es path:/everything-else
host:example.com path:/LANG/everything-else

The only solution I figured out is to make a catch all routes match '*' => 'website#routing' and to monkey-patch all the path helper but I guess it’s not the best to maintain in the future the application.

Any solutions ?

  • 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-21T20:46:41+00:00Added an answer on May 21, 2026 at 8:46 pm

    I’d suggest setting up your routes to consistently map everything to path /LANG/…, then using your web server to rewrite URLs for the language-specific domains. So for example with Apache, you could use something like this:

        RewriteEngine On
    
        RewriteCond %{SERVER_NAME} example.de
        RewriteCond %{REQUEST_URI} !^/de
        RewriteRule ^.*$     http://%{SERVER_NAME}/de%{REQUEST_URI} [R]
    
        RewriteCond %{SERVER_NAME} example.es
        RewriteCond %{REQUEST_URI} !^/es
        RewriteRule ^.*$     http://%{SERVER_NAME}/es%{REQUEST_URI} [R]
    
        # etc.
    

    (I’m not sure the RewriteCond is actually correct – it’s supposed to say “every request path that doesn’t start with ‘/de’, ‘/es’ etc.)

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

Sidebar

Related Questions

I have some strings, entered by users, that may look like this: ++7 7++
Here's some easy reputation for someone. The scenario I have a table that is
I have some text with hard line breaks in it like this: This should
I am wondering if it is an easy task. I need to have some
I am new to BI/Datawarehousing, and after building some easy samples, I have the
I write some easy parser for my page and have some problem with it.
I have some data SELECT [field names] FROM [several joined tables] WHERE [some criteria
I'm currently implementing a navigation system for routing through Europe. So far, I have
is there some easy way to force drupal into showing a block ABOVE the
I'm new to Quartz2d so I hope this is an easy question to answer.

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.