Forum Moderators: phranque

Message Too Old, No Replies

503 and errorpage containing images

         

BlueBlizz

12:29 pm on Apr 23, 2010 (gmt 0)

10+ Year Member



Hi,

If our loadbalancer cannot connect to servers it redirect to a backup server where an errorpage is located.
I managed to redirect every input URL to /error.example.com/
(in httpd.conf the DirectoryIndex is index.html)

But now I want to have this page returned a code 503 (for Google purposes).
The page has .css and images included.
A redirect like [NC,R=503,L] give a error
Starting httpd: Syntax error on line 426 of /etc/httpd/conf/httpd.conf:
RewriteRule: invalid HTTP response code for flag 'R'


How to do so?

my httpd.conf part:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteLog "/tmp/rewrite.log"
RewriteLogLevel 5

RewriteCond %{QUERY_STRING} ^(.+)
RewriteRule ^ /? [R=301,NC]

RewriteCond %{REQUEST_URI} !/Media [NC]
RewriteCond %{REQUEST_URI} !/index.html [NC]
RewriteCond %{REQUEST_URI} !/css [NC]
RewriteCond %{REQUEST_URI} /(.+)
RewriteRule ^ / [R=301,NC]
</IfModule>


using:
RedirectMatch 503 ^(.*)index.html
ErrorDocument 503 /index.html

result in the 503 default page, but not my designed index.html errorpage.

Eric

[edited by: phranque at 1:15 pm (utc) on Apr 23, 2010]
[edit reason] exemplified domain [/edit]

jdMorgan

10:26 pm on May 6, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See duplicate thread [webmasterworld.com...]

Jim