Archive for the ‘Server Configuration’ Category

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]

Sending PHP email via external SMTP server

Monday, October 13th, 2008

I recently installed a WAMP (Windows, Apache, MySQL and PHP) setup on my copy of Windows Vista and set up an installation of Bamboo Invoice. I created an invoice to send to a client but then realised there was no PHP mail configuration. I couldn’t be bothered (and am not very expert) setting up a mail server on my computer, but it occurred to me that I could just reference the SMTP server provided by my ISP that I use for my usual email sending.

(more…)