Introducing YippieMove '09. Easy email transfers. Now open for all destinations.
Dec
03.

A while back Viktor had to make a server redirect from http://domain.com to http://www.domain.com. He experienced some issues because of his lack of control over the server which he wrote about here.

Also the other day we featured an article about the importance of having a unified URL. Since

http://www.domain.com/article.html

looks different than

http://domain.com/article.html

to del.icio.us and similar services, you might not get all that nice attention you deserve. In our article we suggested using Cuzimatter to alleviate the problem. We also linked to a suggestion by Pronet Advertising’s URL’s matter. This article mentions that redirecting everyone to the same URL, if possible, is useful too.

We already use our own solution, Cuzimatter to promote unified links to our articles. But today as you might have noticed, we have also added the other solution: any address on http://playingwithwire.com now redirects to http://www.playingwithwire.com.

Luckily, we have a little bit more control over our own server than Viktor did when he was working with this earlier. So on Playing With Wire, the redirect is as simple as it gets. We use Apache 2 as our web server. Our httpd.conf used to look something like this:

<virtualhost> ServerName playingwithwire.com ServerAlias www.playingwithwire.com

All we had to do was to change this a little bit. (Note that the Redirect pemanent thing should be just one line including the http://… part.) Here’s the modified configuration:

<virtualhost> Servername playingwithwire.com Redirect permanent / http://www.playingwithwire.com/ </virtualhost> <virtualhost> ServerName www.playingwithwire.com ...

All done! Works for every page on the site and does not require slow .htaccess files or complicated mod rewrite rules.

Author: Tags: , ,

Trackbacks/Pingbacks

  1. Playing With Wire » How do you redirect a webpage from http://domain.com to http://www.domain.com without mod_rewrite?

2 Comments

  1. Viktor says:

    For more information about Apache’s vhost, I’d recommend you to visit Apache Virtual Host documentation.


© 2006-2009 WireLoad, LLC.
Logo photo by William Picard. Theme based on BlueMod © 2005 - 2009 FrederikM.de, based on blueblog_DE by Oliver Wunder.
Sitemap