简体   繁体   中英

Ruby on Rails app in root directory?

Hey guys, new to rails, but I have found out how to create an app now through the shell but to create an app using rails appname would give me a url of http://url.com/appname/ but I want my app, to be within the route if you understand me, so it's just http://url.com/login/ or /signup or /play so on?

So does anyone have any ideas how to do this, or why you can't or I shouldn't? Anything really, thanks guys!

if you use passenger and apache, firstly in your apache conf file

<VirtualHost *:80>
  ServerName myapp.local
  DocumentRoot "/home/davit/myapp/public"
</VirtualHost>

DocumentRoot should be point to your app' s public folder.

And in public folder create a .htaccess file and write this:

PassengerEnabled on
RailsEnv development

It depends on your hosting provider, with dreamhost , which I use, its part of the tools they provide to configure where do I want the application to be.

If you have to configure things yourself, you can still write your alias configuration or whatever your server uses to map to your rails application public/ folder.

Rails application is stored in some directory like appname but it doesn't appear in url path. In general you should configure your server (Apache, nginx, ...) to point to public folder in rails application. The only thing to do is to configure your server properly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM