Solved

Apache Redirect WWW

Posted on 2014-11-04
2
153 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 83

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…

821 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