[coral-users] Adding the redirect-home header

Leo Laporte leo at leoville.com
Sat Mar 5 12:13:21 EST 2005


I'm no expert, but I do have root access to my server so I was able to
get the "X-Coral-Control: redirect-home" header working (with Michael's
help) using the following method with an Apache server. This worked for
me, but I would consult a local expert if you have one.

1. Ensure that mod_headers is on
<http://httpd.apache.org/docs/mod/mod_headers.html>
 
This module is loaded in the httpd.conf file but it is NOT turned on by
default. On most configurations you can turn it on by adding two lines to
your conf file. In the LoadModule section add:
    LoadModule headers_module     libexec/mod_headers.so
And in the AddModule section add.
   AddModule mod_headers.c

Then restart Apache. If it won't restart, something is wrong. Comment out
the lines and seek help.

2. Make sure your Apache config allows the use .htaccess configuration
files and that the Headers directive is allowed. 
<http://apache-server.com/tutorials/ATusing-htaccess.html>

3. Create an .htaccess file in an appropriate directory with the
following line in it (or add this line to an existing .htaccess file):
Header append X-Coral-Control "redirect-home"

Since I only use Coral for my podcast files I put this .htaccess
directive only in the directories with podcast files. The Header append
will cause your server to barf if you don't have mod_headers turned on -
so make sure to check your site after you create the file to see that
it's still working. (I got 500 errors until a added mod_headers to the
conf file). 

The drawback of this technique is that EVERY HTTP request for files in
the affected directories will include the X-Coral-Control: redirect-home
header. I'd like to know if there's a conditional I can add to check for
the user-agent before sending the additional header. In particular, is
there a way to use mod_rewrite to do this?

I tested the configuration using the technique Michael recommended
earlier on this list:

-bash-2.05b$ telnet leoville.tv 80
Trying 67.18.41.29...
Connected to 29.67-18-41.reverse.theplanet.com (67.18.41.29).
Escape character is '^]'.

GET /airchecks/.htaccess HTTP/1.1
Host:www.leoville.tv
user-agent: CoralWebPrx/0.1.12

HTTP/1.1 200 OK
Date: Sat, 05 Mar 2005 16:51:58 GMT
Server: Apache
X-Coral-Control: redirect-home
Last-Modified: Fri, 04 Mar 2005 17:00:25 GMT
ETag: "4f0035-2e-42289429"
Accept-Ranges: bytes
Content-Length: 46
Connection: close
Content-Type: text/plain

Header append X-Coral-Control "redirect-home"
Connection closed by foreign host.

It seems to work for me. Now to see if it makes any difference with Coral.

Leo

-- 
Leo Laporte                           <http://leoville.com>
KFI AM 640, Los Angeles                  Sat-Sun, 11a to 2p
Call for Help on G4techTV Canada             Weekdays at 6p 
PO Box 1018, Petaluma, CA 94952   <mailto:leo at leoville.com>



On Sat, 5 Mar 2005 10:43:54 +0100, franck said: 

>
>> Basically, I've implemented failover, such that if you want Coral to
>> always redirect back to your origin site when it can't handle it, you
>> should:
>>
>> 1. Add a header line:
>>
>>      X-Coral-Control: redirect-home
>
>thanks,
>seem's to be great,
>i'am a begginer , so i just ask you were to put this line ? in with file or
>folder ?
>
>best regards,
>
>Franck
>




More information about the coral-users mailing list