?
Solved

How to redirect to another server when the first server can't serve the page

Posted on 2004-08-04
3
Medium Priority
?
191 Views
Last Modified: 2010-03-04
Can anybody help. I am using Oracle iAS (10g) which uses the Apache Web Server. I have two identical servers hosting the same application. I want clients to be able to request the app from the first server, but if this server can't serve the exact page asked for then the second server will send the page. Effectively I want url redirection, but only if the page requested by the initial url can't be served. How do I check that the page can't be served and then how do I initiate redirection to server 2?

Please help!

0
Comment
Question by:jasperkirkman
1 Comment
 
LVL 4

Accepted Solution

by:
TomDavidson earned 2000 total points
ID: 11716975
This will forward all requests for pages that don't exist to another domain, kinda like a 404 document. It can be put in an .htaccess file or within the virtualhost section of the conf file.

#Initiate the rewrite engine
RewriteEngine on

#Check file does NOT exist
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f

#Rewrite url to request from other server
#R flag sends "302 - Moved Temporarily" status to browser to initiate redirect
#L flag instructs rewrite to not process other rewrites
RewriteRule    ^/(.*)$    http://www.otherdomain.com/$1    [R,L]
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Integration Management Part 2
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month16 days, 5 hours left to enroll

850 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