Posts Tagged ‘www prefix’

removing www using .htaccess

Wednesday, November 19th, 2008

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]

Wordpress MU and the www prefix

Sunday, July 27th, 2008

Nowadays, the www prefix is considered to be a redundant relic. In order to support the no-www initiative, Wordpress MU is by default set up so that the www prefix is stripped from URLs. For example, if one typed in http://www.example.com to access a Wordpress MU installation, they would end up at http://example.com.

Now, for some reason it might be the case that you do want the www to remain (I don’t mind having the www stripped, but from my experiences with installing Wordpress MU for clients, it is often the case that they want the www prefix to remain). However, this is apparently not a straightforward thing to achieve in Wordpress MU.

(more…)