Category Archives: internet

Google+ For the Win!

Last month Google+ introduced Collections https://plus.google.com/collections/welcome
A devilishly simple way to group your posts by topic.

When you create a Collection you set the audience, so you can have private collections for posts on a topic to share with a particular audience, or you can have public collections that anyone can follow.

This is a brilliant move on Google’s part. Users can follow topic from a user, rather than every little thing they posts. It’s so simple to share with a collection too, so it’s a win for those posting the content.

Another win is that posts by content are so reader friendly that the take up on followers is very good.

Google+ is becoming my favourite place to post stuff to now, and a great place for a Global community instead of just posting stuff amongst your friends and family. The Internet is the world, not just the people you already know.

I hope more and more of you come round to Google+, and if you don’t, well you’ll be missing out but you won’t be missed, there’s a whole world of people out there.

Mike

Apache mod_rewrite Redirecting Directories Without Looping

Wow! It’s true what they say, mod_rewrite rules are a dark art, and whilst I’ve combed the Internet to find, what I thought would be a simple redirect, I’ve found countless examples that didn’t work.
So now I have one that does work I’m sharing.

Goal

To redirect hits to a subdomain sshwindows.webheat.co.uk to a subdirectory (in my case cause that is the link to the page within my wiki) /display/sshwindows/

Traffic to any other domain hosted on this same server should not be redirected.

All without looping.

Solution

Check two conditions not just one. Check the host header and the uri to ensure the root had been hit, and only then redirect.

Code

RewriteEngine On
RewriteCond %{HTTP_HOST} ^sshwindows.webheat.co.uk$ [NC]
RewriteCond %{REQUEST_URI} /$
RewriteRule ^(.*)?$ http://sshwindows.webheat.co.uk/display/sshwindows [L]

For me I put this into my /etc/apache2/sites-enabled/000-default file, but you can equally put this into a .htaccess file. For me this was to be a global thing.

Additional Notes

The [nc] is the no-case flag to make the host header match case-insensitive.
The [L] is the Last flag, so after this rule no further ones will be processed. In all honesty I don’t need this here, but that part came from another source and it’s 4am so I’ll be damned if I’m going to remove it now when it’s all working 🙂