?
Solved

Need Apache Rewrite Engine rule to redirect URLs

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

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

762 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