httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Mearns <>
Subject Re: [users@httpd] Using a MOTD
Date Mon, 02 Feb 2009 17:57:41 GMT
On Mon, Feb 2, 2009 at 12:42 PM, André Warnier <> wrote:
> wrote:
>> Thanks Brian.
>> Using the "Has_Seen_MOTD" cookie idea is was I thinking of as well. And
>> that's the way the CPAN Apache::MOTD does it. But, I thought the only easy
>> way of reading and writing cookies would require Perl. I guess I was hoping
>> someone would say there is some item in the http.conf file that I could set
>> that would do redirects to the MOTD which then redirect to the originally
>> requested page.
> I'm a great fan of mod_perl myself, but in this case you might want to have
> a look at the "cookie" flag of mod_rewrite:
> search for "cookie".
> And, AFAIK, by default the cookie should be session-only.

Right-o. You can use RewriteCond in the httpd.conf file to check for
the cookie, and only apply the rewrite rule if the cookie is not
present (i.e., it's value is an empty string). The rewrite rule can
then redirect to the MOTD page, and use the [co] flag on the rule to
set the cookie.

So I think that's what you're looking for. As far as I can imagine,
there's no way to reliably redirect one request per session without
using cookies, but that doesn't mean you have to use perl, if you
don't want.


Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from:

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message