Solved

Apache Redirect WWW

Posted on 2014-11-04
2
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

When coding a Webservice to provide data, the normal way is to create a method that returns a Dataset object.   But a Dataset cannot be used easily from another platform, such as PHP,  FLAS (FLEX) , etc. Solution : Return a XML Document instea…
If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

732 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