Search code examples
ruby-on-railsapachepassengerrubber

How can I configure rails to not use 'www' for my website?


I am not sure where this setting is. Currently my site redirects every non-www URL to www. I am using the Rubber gem to deploy to AWS which in turn uses Passenger, and I've seen some posts which suggest the configuration for this lies with Passenger. I am using Apache 2


Solution

  • This task is done by configure correctly the virtualhost of your server (not RoR or Passenger).

    You should localize the host file on your webserver (apache, nginx,..) and put something like this:

    <VirtualHost *:80>
        DocumentRoot /www/example1
        ServerName example.com
    
        # Other directives here
    </VirtualHost>
    

    Maybe this link can help you: http://httpd.apache.org/docs/trunk/vhosts/examples.html