1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mod_rewrite help needed

Discussion in 'PHP & Perl' started by 5VM5UN6, Jul 21, 2010.

  1. 5VM5UN6

    5VM5UN6 Registered Member

    Jun 18, 2009
    Likes Received:
    Here's the thing. I just can't get it right. I need the rewrite condition match when cookie called SomeCookie hold value of requested filename. As of now {REQUEST_FILENAME} holds the filename and full directory of requested file ( for example /home/me/public_html/some_folder/master_mod_rewrite_in_one_hour.pdf and i only need the filename - master_mod_rewrite_in_one_hour.pdf)
    RewriteEngine On
    RewriteCond %{HTTP_COOKIE} !SomeCookie={REQUEST_FILENAME} [NC] 
    RewriteRule .* http : / / far.far.away [L]
    How do i do that?