Forum Moderators: phranque
The spectre was raised on the members forum regarding Google listing a site by IP and therefore creating a possible suplimental / duplicate material problem. Marcia kindly put up an Apache redirect but suggested to make sure here it is OK;
RewriteCond %{HTTP_HOST} ^12\.34\.56\.78
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Is that golden?
Mod_rewrite code can almost never be "golden," because *you* must decide what functions you want and need for your site.
For example, what about the non-www variation, which can also cause duplicate listings? You can add a function to take care of that, too:
RewriteCond %{HTTP_HOST} ^12\.34\.56\.78 [OR]
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
The hardest thing about server configuration is deciding precisely what you want and need to do. Once that is done, only coding and testing remain. And those latter two parts of the job are the easy parts. :)
Jim