Using naked domains with google sites

I wanted to host my google site at my naked (root) domain brandon-cs-sanders.com rather than at a subdomain like www.brandon-cs-sanders.com.  Google sites doesn't provide a mechanism to host your site at a naked domain.  The best they provide is a way to forward from a naked domain to a third-level domain.

My solution was to setup a reverse proxy on another web server that I control.  If you don't have another web server that you can adjust the configuration on ... this won't work for you.

In addition to enabling mod_proxy and mod_proxy_http I setup a virtual host for brandon-cs-sanders.com that proxies to an unusual third-level domain at google.  That way the typical third level domain for a website (www) redirects to my naked domain.

Here is my virtual host configuration for brandon-cs-sanders.com

<VirtualHost *:80>
ServerName brandon-cs-sanders.com
ServerAlias *.brandon-cs-sanders.com
ServerAdmin my-first-name@brandon-cs-sanders.com

ProxyPass / http://gwww.brandon-cs-sanders.com/

ErrorLog ${APACHE_LOG_DIR}/brandon-cs-sanders.com-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/brandon-cs-sanders.com-access.log combined
</VirtualHost>


Comments