[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Redirect one URL to another in Apache 2

Posted on 2010-11-17
1
Medium Priority
?
430 Views
Last Modified: 2012-05-10
I look after an Apathe web server that has multiple web sites via vhosts files defined in /etc/apache2/vhosts.enabled

I have three sites www.anuenterprise.com.au, www.anuenterprise.com and www.anutech.com.au that resolve to the same IP. I would like to set up the following

user enters www.anuenterprise.com in browser and is redirected to www.anuenterprise.com.au
user enters www.anutech.com.au in browser and is redirected to www.anuenterprise.com.au

All attempt to redirect in the vhosts files has failed so far.
0
Comment
Question by:dlg654
[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
1 Comment
 
LVL 13

Accepted Solution

by:
dsmile earned 2000 total points
ID: 34161349
Create a file named .htaccess with content as attached code and put it in document root of your site


RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.anuenterprise\.com\.au$ [NC]
RewriteRule ^(.*)$ http://www.anuenterprise.com.au/$1 [R=301,L]

Open in new window

0

Featured Post

Independent Software Vendors: 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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

649 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