Solved

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

Posted on 2004-08-04
3
185 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
3 Comments
 
LVL 4

Accepted Solution

by:
TomDavidson earned 500 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
XAMPP 3 68
browser caching 4 77
Do you know any Office editor web for IIS or Apache web server)??? 10 100
Need To Change Centos 6 Timestamp Form In Log File 24 92
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…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

840 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