redirecting domain.com to www.domain.com.

Apache Apple HOWTOs UNIX Web Development

So you have a web server and one/some domain names. You want to have all requests to domain.com to go to www.domain.com. most companies have this redirect in place (Apple is an example). I was stumped when I first set out to do this…so here is what I learned from our friends on the Apache mailing list.

ServerName www.domain.com
ServerAlias domain.com
Redirect permanent / http://www.domain.com/

ServerName www.domain.com
ServerAdmin webmaster@domain.com
DocumentRoot /Volumes/www/domain.com/documents


This set up in Apache will then redirect all domain.com requests to www.domain.com.
You cannot beat mailing lists’ support!
[tags]apache, vhosts, redirect[/tags]

Leave a Reply

Your email address will not be published.
*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.

WordPress

new photo plugin.

I am installing more and more plugins to further customize my blog. Today: wp-photo by Alex King.

Politics Standards

On the Gay Marriage Amendment

I have had enough. The jokes, the comments, the bashing, and now the proposed marriage amendment? I do not understand the big deal…and I am tired of the christian right constantly trying to tell me how to live. Bush wants to “preserve marriage”, but he and his christian right friends do not get it…so let […]