Solved

Need Apache Rewrite Engine rule to redirect URLs

Posted on 2007-03-22
1
311 Views
Last Modified: 2013-11-19
I have two URLs, www.url-1.com and www.url-2.com both  pointing to the same Apache-UNIX hosting account.  In the root ofthis account I have two index files, index_1.htm and index_2.htm.

When a visitor surfs to www.url-1.com, I want index_1.htm to load
but if they surf to www.url-2.com, I want  index_2.htm to load.

I'm looking at the Apache Rewrite Engine, and cannot for the life o me come up with a conditoin/rule set that will make this happen.

Anyone?

Thank
0
Comment
Question by:xfvgdrthbdtyvhgscv
[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 10

Accepted Solution

by:
ClickCentric earned 500 total points
ID: 18776535
The following is from memory, but seems about right:


RewriteEngine on
RewriteBase /


RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\.url-1\.com$ [NC]
RewriteRule ^(.*)$ http://www.www.url-1.com/index_1.html [R=301,L]
RewriteCond %{HTTP_HOST} !^www\.url-2\.com$ [NC]
RewriteRule ^(.*)$ http://www.www.url-2.com/index_2.html [R=301,L]
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

Title # Comments Views Activity
Easy responsive table out of existing table 28 62
Button to go back 3 39
CSS: Making Pure CSS read more boxes thinner 5 45
WordPress: Debugging from my Windows 10 Desktop 6 63
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

749 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