?
Solved

Apache Redirect WWW

Posted on 2014-11-04
2
Medium Priority
?
171 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 84

Accepted Solution

by:
Dave Baldwin earned 1500 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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month10 days, 8 hours left to enroll

764 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