Using naked domain in apache, no "www" on domain in httpd.conf

Posted by chrsdgtl on Server Fault See other posts from Server Fault or by chrsdgtl
Published on 2012-12-15T23:21:01Z Indexed on 2012/12/16 5:07 UTC
Read the original article Hit count: 620

Filed under:
|
|
|

Incredibly there is no good tutorial or easy reference guide for using naked domains (no subdomain) as the primary URI online that I could find.

I'm trying to configure this to happen in my httpd.conf in apache. Since I'm still a relative newb to this server stuff, trying to figure it out myself all I could do was configure some nasty redirect loops and error 400's.

There's plenty of notes for the more common:

http:// --> https://

and

naked to --> www.

and a ton of .htaccess stuff (not interested)

What I want is http://www.domain.com --> http://domain.com

The most helpful thing I found was this: Multiple domains (including www-"subdomain") on apache?

I ended using the solution mentioned by ceejayoz in that post that some folks noted was messy and complicated because it got the desired result but I'd like to know the best practice for this in the future.

I'd appreciate a nudge in the right direction.

Thanks in advance.

© Server Fault or respective owner

Related posts about apache2

Related posts about domain