Solved

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

Posted on 2004-08-04
3
182 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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now