Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need Apache Rewrite Engine rule to redirect URLs

Posted on 2007-03-22
1
Medium Priority
?
315 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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Suggested Courses

618 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