?
Solved

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

Posted on 2004-08-04
3
Medium Priority
?
188 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
[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
3 Comments
 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

770 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