 |
 |
.htaccess question...
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2003
Location: MD, USA
Status:
Offline
|
|
Hello hello,
Recently, I created a .htaccess file for one of my websites, to prevent hotlinking, as there have been a number of hotlinking issues in the past.
Recently, I discovered that I'd forgotten something: There's a directory called /banners/ that I use for their banner exchanges. Now, those images are showing up as broken in the banner exchanges. Below is my .htaccess file, placed in the root of their site. Any help so as to allow all the GIF and JPG/JPEG files in the /banners/ directory would be of great appreciation.
Code:
ErrorDocument 404 /404.php
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?theirdomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]
Thanks again for the help (in advance).
|
|
-Nitz
*************************************
* iBook G3 900mhz/640mb/12.1"/40gig
* 30gig iPod 3rd Gen.
*************************************
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status:
Offline
|
|
I've just woken up so I can't get my brain to remember the specifics, but I do remember that the .htaccess files are inherited on a per-directory basis, and that a child can easily override its parent.
So if you can add the directives to turn off rewriting to a .htaccess file within that specific directory you should be able to achieve what you want.
Hope that helps
|
|
Computer thez nohhh...
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2003
Location: MD, USA
Status:
Offline
|
|
Figured it out. In the root of the site, here's the .htaccess:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !domain\.com [NC]
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteRule \.(gif|jpe?g|png|psd)$ - [F,NC,L]
For any directory which I want to ignore the root's rules, I drop this .htaccess file into it:
RewriteEngine on
RewriteRule ^.*$ -
Thanks much for the assistance.
|
|
-Nitz
*************************************
* iBook G3 900mhz/640mb/12.1"/40gig
* 30gig iPod 3rd Gen.
*************************************
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |