Solved

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

Posted on 2004-08-04
3
184 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

774 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