.htaccess question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bawdy
    Confirmed User
    • Feb 2002
    • 1424

    #1

    .htaccess question

    Im using the following htaccess in the top level of my domain. This works fine for all documents in sub-folders... the images show properly... but on the top level (ie default document) the images dont display. How can I correct this so that the images show properly in the default document?


    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
    RewriteRule \.(gif|jpg)$ - [F]
  • Lycanthrope
    Confirmed User
    • Jan 2004
    • 4517

    #2
    Try this:

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com:80.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://ip.ip.ip.ip.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://ip.ip.ip.ip:80.*$ [NC]
    ReWriteRule .*[Jj][Pp][Gg]$|.*[Jj][Pp][Ee][Gg]$|.*[Gg][Ii][Ff]$ - [F]

    It is something to do w/ them slashes I'm guessing...

    Use the one above as it includes your IP and port 80 and also you won't have to worry about case issues should you get a content provider that names everything in caps and you don't feel like renaming all the pics....

    Comment

    • bawdy
      Confirmed User
      • Feb 2002
      • 1424

      #3
      perfect thanks

      Comment

      • V_RocKs
        Damn Right I Kiss Ass!
        • Nov 2003
        • 32449

        #4
        Sweet!

        Comment

        Working...