How can I set a base route for rails?

My home address is something like

www.hosting.com/~myid/

I uploaded my rails blog app in the blog folder,

www.hosting.com/~myid/blog/

and I ran 'rails server' to launch server. (in default, it will use port 3000)

When I connect to the www.hosting.com:3000/~myid/blog/ It shows the routing error - No route matches "/~myid/blog"

It seems that rails application is accepting /~myid/blog as controller&action.

I assume /~myid/blog/ will be the base address for every routing that will come to this address.

How can I resolve this problem???

My home address is something like

www.hosting.com/~myid/

I uploaded my rails blog app in the blog folder,

www.hosting.com/~myid/blog/

and I ran 'rails server' to launch server. (in default, it will use port 3000)

When I connect to the www.hosting.com:3000/~myid/blog/ It shows the routing error - No route matches "/~myid/blog"

Try just www.hosting.com:3000/

Colin

cielo wrote in post #973129:

I assume /~myid/blog/ will be the base address for every routing that will come to this address.

How can I resolve this problem???

You're web server's virtual host should set /~myid/blog/public as the site's DocumentRoot. You should be able to set this up in the .htaccess file that your shared hosting company provides for you.

Typically Apache or Nginx is used as a front-end web server for Rails applications and something like Phusion Passenger to take care of the interaction between the web server and the Rails application. Typically the web servers provided by rails server are not really suitable for production level deployment on their own. Generally speaking static assets are delivered by the front-end web server (Apache or Nginx).

Example:

<VirtualHost *:80>   ServerName www.example.com   ServerAlias example.com   DocumentRoot /var/rails/my_app/public </VirtualHost>