Solved

Apache Redirect WWW

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
The task of choosing a web design company to build a website for your business should never be taken in a light manner. Provided the fact that your website will act as a representative to your business and will be responsible for imposing an online …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

816 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

9 Experts available now in Live!

Get 1:1 Help Now