Hi, I am trying to install a RubyOnRails application on shared hosting powered by cPanel.
Using the RubyonRails link of cPanel I have created a Rails application and able to access it using a URL like http://www.domain.com:12001/ . But I want to run the application in URL like http://subdomain.domain.com/
On cPanel i have created a subdomain and pointed to the Rails application root folder. Then using the links and buttons provided on "Manage Ruby on Rails application" page of cPanel, I have made ReWrite of http://subdomain.domain.com/ to http://www.domain.com:12001/ . This created .htaccess file in the root folder of the Rails application. The file contains following text,
And now if i try to access http://subdomain.domain.com/ , I am getting 404 page.RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdmain.domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.subdmain.domain.com$
RewriteRule ^(.*)$ "http\:\/\/127\.0\.0\.1\:12001%{REQUEST_URI}" [P,QSA,L]
As I read from mod_rewrite manual, that "P" in [P,QSA,L] stands for force proxy which require mod_proxy. So, I contacted the hosting provider and they are saying that mod_proxy is not required and they will not provide mod_proxy on shared hosing.
I tried 301 type redirect, in that case http://subdomain.domain.com/ gets redirected to http://www.domain.com:12001/, but that ":12001" is being shown on the address bar of browser. I need silent redirect.
Can anybody provide any comment about whether I need mod_proxy or if there is any alternative way.


LinkBack URL
About LinkBacks
Reply With Quote