Categories
.htaccess Code

Todays .htaccess tip – How to get rid of the www. subdomain

#www. is overrated
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)
RewriteRule ^(.*)  http://%1/$1 [QSA,L,R=301]

Now let’s explain how this works:

The first line is a comment, that explains what the rewrite is supposed to do.

This line just turns on the rewrite engine

RewriteEngine On

This line says if the domain is “www.anything” and note that it saves the domain without the www. part as %1

RewriteCond %{HTTP_HOST} ^www\.(.*)

now this line does the actual rewriting. from anything to the domain with the query string attached (QSA) so we won’t break links. also note that it is a permanent redirect (the R=301 part) and it’s the last rule (L) that will be executed for this request.

RewriteRule ^(.*)  http://%1/$1 [QSA,L,R=301]
Categories
Mac OS x

Mac OSx on the go

If you have read my previous post about OSx, then you might wonder a bit when i tell you that i am still using OSx. I could have installed Linux or even Windows on the Macbook.

But there are some reasons for me to keep using OSx. First reason being that i paid for OSx.  The other reason being that i like the mobility of the Macbook. I just close the lid and it goes to sleep once opened it’s back.  Yes Windows and Linux can do the same but not nearly as good.

I am really happy with the Hardware ever since i upgraded the Ram to 8GB and installed a SSD as my main disc. I can not really complain about lag since i don’t really see any lag anymore.

What still annoys me, is that since i updated to Lion i have to reboot a lot more than before. It’s due to many things. sometimes it’s just a program that hangs itself up or sometimes it’s even the login screen that get’s stuck (haven’t that for a while though)

I am actually thinking of trying Linux on my Macbook, maybe a dualboot work. It would be interesting to see if i can get Archlinux to work just well with the suspend and hibernation as OSx does.

But a reinstall will probably not happen until i have enough of Diablo 3 (y u no out yet)