Redirect URLs in Lighttpd

I’m going to redirect http://blog.rootninja.com to the main site. I don’t know why I didn’t just do this in the first place. I’ve always left it over here on its own. But it’s all on the same Virtual private server. Anyway, this is really easy to do in lighttpd. First, redirect all “www.rootninja.com” traffic to “rootninja.com”, because that other page is useless.

$HTTP["host"] =~ “^www\.(.*)$” {
url.redirect = ( “^/(.*)” => “http://%1/$1″ )
}

And now to redirect the “blog” part.

$HTTP["host"] =~ “^blog\.rootninja\.com” {
url.redirect = ( “^/(.*)” => “http://rootninja.com/$1″ )
}

Oh and mod_redirect must be enabled for this to work. And now I just need to go edit the config and restart lighttpd.

Posted by admica   @   18 November 2009

Related Posts

0 Comments

No comments yet. Be the first to leave a comment !
Leave a Comment

Name

Email

Website

Previous Post
« Clustered Samba on GFS2 in Fedora 12
Next Post
Easy install flash player in Firefox on Fedora 12 »
Powered by Wordpress   |   Lunated designed by ZenVerse