removing www using .htaccess
I was looking to change the way my personal website at simondalfonso.id.au is accessed. Currently, both http://www.simondalfonso.id.au and http://simondalfonso.id.au work separately. I wanted to change it so that the www version re-directs to the non-www version, in effect removing the www prefix (See here for some history on the topic).
The following piece of code added to a .htaccess file achieves this nicely:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Tags: www prefix

















































