Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question http:// to http://www.

    I'm using the .htaccess file below to stop hotlinking to images on my site. It works fine for http://www.stephennewton.com, but http://stephennewton.com is treated as a hotlinker.

    I'm told I can set it for both http://stephennewton.com and http://www.stephennewton.com, but don't know how.

    The code I'm using is...
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://www.stephennewton.com/.*$ [NC]
    RewriteRule \.(gif|jpg)$ http://us.f2.yahoofs.com/users/402b5...Ri.4ABcv2FZBc3 [R,L]

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Just a guess
    Code:
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://www.stephennewton.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://stephennewton.com/.*$ [NC]
    RewriteRule \.(gif|jpg)$ http://us.f2.yahoofs.com/users/402b...hRi.4ABcv2FZBc3 [R,L]

  • #3
    Regular Coder
    Join Date
    May 2004
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts
    and: RewriteEngine On - note the uppercase: On

    also, your RewriteRule only rewrites literally .gif or .jpg. Which makes no sense. It should somehow match a filename in front of the extension.
    So, better change that into: RewriteRule .*\.(gif|jpg)$ http:// etc..

  • #4
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks Nightfire...

    ...that worked


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •