Mobile app version of vmapp.org
Login or Join
LarsenBagley505

: To WWW or not to WWW I'm getting ready to deploy my Rails app. Currently whether you browse to it using www.domain.com or just domain.com you get the same site. I'm pretty new at this, so

@LarsenBagley505

Posted in: #NoWww #Redirects #RubyOnRails

I'm getting ready to deploy my Rails app. Currently whether you browse to it using domain.com or just domain.com you get the same site.

I'm pretty new at this, so I'm looking for some wisdom from experienced web app developers:

Is it worth forcing requests to either WWW or non-WWW? It seems there are apps that go either way...

I know that this kind of question is in danger of being too subjective, but to help keep it objective here's a few specific questions that I'd really appreciate answers to:


Does your web app force requests to WWW or root domain, or does it allow both equally?
What technical reasons are there for choosing one option or the other (honestly I don't know if it even makes a difference).
If you were building a new web app today, which option would you choose?


I appreciate any advice.

--EDIT--

To reiterate what I'm looking for as distinct from this question are there specific ramifications for web applications that I should be aware of before I make a decision and deploy? In particular if any Rails developers have had issues related to one option or the other that would be really helpful to know.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @LarsenBagley505

1 Comments

Sorted by latest first Latest Oldest Best

 

@Merenda212

Use www as the default one and force redirect to www with this htaccess script:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.WEBSITE.com$
RewriteRule ^(.*)$ www.WEBSITE.com/ [R=301]


This way you avoid duplicate content on Google.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme