We are hosting many web applications for our customers. As is obvious they want to use their own domains to refer to those applications, usually they want that any user tha
I see readytocloud.com is hosted on Apache 2.2.
There is a much simpler and more efficient way to redirect the non-www site to the www site in Apache.
Add the following rewrite rules to the Apache configs (either inside the virtual host or outside. It doesn't matter):
RewriteCond %{HTTP_HOST} ^readytocloud.com [NC]
RewriteRule ^/$ http://www.readytocloud.com/ [R=301,L]
Or, the following rewrite rules if you want a 1-to-1 mapping of URLs from the non-www site to the www site:
RewriteCond %{HTTP_HOST} ^readytocloud.com [NC]
RewriteRule (.*) http://www.readytocloud.com$1 [R=301,L]
Note, the mod_rewrite module needs to be loaded for this to work. Luckily readytocloud.com is runing on a CentOS box, which by default loads mod_rewrite.
We have a client server running Apache 2.2 with just under 3,000 domains and nearly 4,000 redirects, however, the load on the server hover around 0.10 - 0.20.