htaccess redirect help needed

Discussion in 'Apache' started by AuctionFreak, Jan 29, 2007.

  1. #1
    I've saw this before over at phpbb.com but am unable to find it. What I want is a section of my site which is only possible to access by clicking on a specific link.

    If users don't come from this specific link I'd like to redirect them to another page - i.e a login page.

    Any help would be appeciated, thanks.
     
    AuctionFreak, Jan 29, 2007 IP
  2. lookzovt

    lookzovt Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Maybe this way?

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yourdomain\.com/pagewithlink\.htm [NC]
    RewriteRule .*pagewithlink\.html$ ^http://login_script_address/$ [R=301,L]
    
    Code (markup):
     
    lookzovt, Jan 30, 2007 IP