Preserved Topic: .htaccess to Replace Image |
|
---|---|
Author | Thread |
Paranoid (IV) Mad Scientist From: Inside THE BOX |
posted 05-15-2002 04:24
So, I'm trying to incorporate the following into my .htaccess to prevent others from linking to my images from their sites: |
Maniac (V) Inmate From: Brisbane, Australia |
posted 05-15-2002 05:06
I honestly wouldn't have a clue what the correct syntax would be but shouldn't the apology.gif at least mention your domain? |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 05-15-2002 08:31
If your .htaccess file is located in the root folder (where apology.gif resides), server will go into infinitie loop when trying to redirect to apology.gif (which will also be blocked), and that's why people get red X after some period of time (after timeout). Try to move .htaccess to some other folder (i.e. where your images are located), and see what will happen. |
Paranoid (IV) Mad Scientist From: Inside THE BOX |
posted 05-15-2002 19:57
Hmm... Moving it works, but now the problem is that it only applies to that directory down. |
Paranoid (IV) Mad Scientist From: Inside THE BOX |
posted 05-19-2002 03:25
Whoa! I just noticed something. I'm here at work and every image is being blocked and replaced with the "sorry" image. Would the fact that I'm having to go through a proxy server cause this? |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 05-19-2002 11:22
As you have noticed the problem is with trailing slash. For some reason web browser isn't automatically redirected to the address with trailing slash (this can be caused by proxy server, and also by screwed IE installation). To make it work with and without trailing slash, just modify regular expression in mod_rewrite condition so that it doesn't include slash at the end, like this: |
Paranoid (IV) Mad Scientist From: Inside THE BOX |
posted 05-19-2002 18:35 |
Paranoid (IV) Mad Scientist From: Inside THE BOX |
posted 05-19-2002 23:45 |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 05-20-2002 03:37
Would something like this work: |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 05-20-2002 07:26
You forgot to add "." any character operator. Also, I would use "+" quantifier instead of "*" quantifier. The correct code should look something like this: |