Solved

Apache Redirect WWW

Posted on 2014-11-04
2
141 Views
Last Modified: 2014-11-04
We have two domains pointed to an IP on an Apache Server on a Centos 7 box.

domain1.com  & domain2.com

What setting do we need to set so that if someone types in
www.domain2.com
it doesn't redirect to
domain1.com

Both of these domains are pointed to the same IP. But in Apache they are of course pointed to separate folders.  Currently if you type in www.domain2.com it goes to the website for Domain1.com.
0
Comment
Question by:FirstDirect
2 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40423324
You use 'name based' virtual hosting.  Here is the Apache page on the subject:  http://httpd.apache.org/docs/2.2/vhosts/name-based.html
0
 

Author Closing Comment

by:FirstDirect
ID: 40423335
Resolution was achived by changing the Virtual Host to listen on Any Address and by editing the ServerName to include the WWW

then created a ServerAlias for the non WWW version of the address.

ServerName www.domain.tld
ServerAlias domain.tld
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now