<p>Using Morph Labs' Appspace to deploy a site means no automated way to redirect 'myapp.com' to 'www.myapp.com' (and no access to .htacess).</p>

<p>Is there an in-rails way to do this? Would I need a plugin like <a href="http://github.com/mbleigh/subdomain-fu/tree/master" rel="nofollow noreferrer">subdomain-fu</a>?</p>

<p>More specifically, I'm trying to do something like:</p>

<ul>
<li>'myapp.com' => 'www.myapp.com'</li>
<li>'myapp.com/session/new' => 'www.myapp.com/session/new'</li>
</ul>

<p>Basically, I always want the 'www' subdomain prepended on every request (because the SSL cert specifically has a common name of 'www.myapp.com').</p>

Here is a couple of different ways:
```
```
head :moved_permanently, :location => ‘http://www.newdomain.com’
```
```
another:
```
```
def rails_301
headers["Status"] = "301 Moved Permanently"
redirect_to "http://www.newdomain.com"
end
```
```