Re: Using a MOTD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 2, 2009 at 12:42 PM, André Warnier <aw@xxxxxxxxxx> wrote:
> dan_b@xxxxxxxxxxx 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:
> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
> 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.

-Brian


-- 
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://pgp.mit.edu/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux