htaccess help

Discussion in 'HTML & Website Design' started by MalcolmHB, Mar 8, 2008.

  1. #1
    Can someone help me with a htaccess script, i need it to block all access to a directory on my website unless they are referred from one specific domain name.

    Thanks
     
    MalcolmHB, Mar 8, 2008 IP
  2. Mitchelle Johnson

    Mitchelle Johnson Banned

    Messages:
    153
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This is one example of htaccess code...

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example\.com [NC,OR]
    RewriteCond %{THE_REQUEST} ^[A-Z][a-z][0-9]\ /index.php [NC]
    RewriteRule .* http://www.example.com/ [R=301,L]


    Redirect "/index.html" to "/" in canonical domain
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
    RewriteRule ^index\.html$ http://example.com/ [R=301,L]
     
    Mitchelle Johnson, Mar 12, 2008 IP