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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:00:52+00:00 2026-05-29T17:00:52+00:00

I want to have 2 Ruby on Rails applications on a domain. The first

  • 0

I want to have 2 Ruby on Rails applications on a domain.

The first one is running at example.com; I have done that with .htaccess (with RewriteRule to example.com:12001)

I want the other one to be in a subdomain, like blog.example.com. So I created a subdomain, and in the file .htaccess I redirect to example.com:12002.

Everything is working fine, but if I go to address example.com/blog, I am not redirected, and I see in browser the contents of blog folder in public_html:

Index of /blog

    Parent Directory

I would like to go to the second application(blog.example.com) when the url is example.com/blog. How could I do that?

  • 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-29T17:00:56+00:00Added an answer on May 29, 2026 at 5:00 pm

    the solution depends on how your hosting provider implements multi-subdomain mapping. Some offer a control panel so that you can register your subdomains and point each to a separate subdirectory in your file space. Some will just map *.yourdomain.zzz to the document root for yourdomain.zzz, and from your description, this is what is happening for you. In this case you need to decode the HTTP_HOST variable and route on that. But you also need to stop your rewrite rule looping so that sub1.yourdomain.zzz doesn’t get mapped to yourDocRoot/sub1/sub1/sub1…`

    If you wanted to process sub1 and sub2 subdomains, then you would do this with a rule in you top level like this:

    RewriteBase  /
    RewriteCond  %{ENV:REDIRECT_INSUB} !=1
    RewriteCond  %{HTTP_HOST}          (sub1|sub2)\.yourdomain\.zzz
    ReweriteRule ^(.*)                 %1/$1         [L,E=INSUB:1]
    

    Search for [.htaccess] HTTP_HOST to see lots of variants of this.

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

Sidebar

Related Questions

In Ruby, I want to have two threads running at the same time, and
Well, the title say it all. I have a ruby script I want running
I want to run javascript/Python/Ruby inside my application. I have an application that creates
I want to make a development server for Ruby. (I have done this for
I have a ruby-on-rails application that wishes to utilise the tumblr gem for adding
If I have a Ruby on Rails application running on my Apache shared server
I have a Ruby on Rails application that will be a CMS in way
Have just finished my first web based application using Ruby on Rails. It was
I have a ruby on rails application with an input text field that has
I currently have a Ruby (Rails) application that needs to make a lot of

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.