cworrell
I learned the following from the WebFaction Community Forums:
- Create a single
redirect
app (Apache).
- Route all of your
www.
prefixed domains to it.
- ex:
www.domainA.com
www.domainB.com
- Create a single
.htaccess file
with the following:
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
Now if someone uses www.domainA.com
, they will be routed to that redirect
app, and the RewriteEngine
in the .htaccess
file will rewrite the URL to the non-WWW. equivalent.
These links will probably die, but here's more discussion about this:
There IS a catch with http
-> https
though. You can read about it in those links.
tl;dr:
You'll get security warnings (certificate mismatch) if you don't add a certificate to redirect
app and try to access https://www.domainA.com
I think it gets a little more complicated than that, but I haven't fully looked into it.
As a result, I may end up just going back to adding that redirect code to each app's .htaccess
file. (Although that wouldn't work if the "naked domain" app can't use .htaccess
rules.)
Thus bringing us full circle back to:
cworrell
Would save a lot of time from setting up simple redirect/.htaccess apps every time