View Full Version : .htaccess


BulbaGrrrl
01-31-2004, 09:45 PM
I'm sorry if for not trying to figure things out, but i need help quick. I got my text file named .htaccess with all the stuff and I uploaded it to my site (actually when I upload it it doesn't show up but I assume it's there.) But the site is still direct linking to me! Should I not upload it in "binary" form or whatever that means?

Here's my site: www.harmonyanime.com
and I'm trying to stop this site from direct linking: http://www.xanga.com/home.aspx?user=xKrNbAyBEeGrLx

Thanks in advance!!!

Rosey
01-31-2004, 10:04 PM
I don't see it either when i uploaded mine so i think that's normal.

Here the explanation from lissa's site:
http://www.lissaexplains.com/html6.shtml#direct

did you put the right stuff in the file?

BulbaGrrrl
01-31-2004, 10:11 PM
here's what I got in it:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?harmonyanime.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?harmonyanime.com.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]


I got it in a few subdirectories though, so maybe do you think it should look like this?:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?harmonyanime.com/subdirectory.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?harmonyanime.com/subdirectory.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]

Rosey
01-31-2004, 10:23 PM
I think if you put the main domain it should work. Does your host support htaccess? If nothing works, replace that image with the exact same image name but put something like "this image was stolen from yourdomain.com
That will teach her.

pb&j
01-31-2004, 10:25 PM
be sure the file is simply...
".htaccess"
nothing before the period, and no .txt afterwards.

be sure your host supports using htaccess, although i think you are on dreamhost and i think they do.

if you put the file into your main directory (normal one) then it will affect any subfolders that it contains.

this is what i have which should work for you ...

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?harmonyanime.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]

i am unsure if you need that second domain name line in there.

this file should be uploaded in "ascii" mode, not binary.

once it is uploaded, you should CHMOD the file to 644.

BulbaGrrrl
01-31-2004, 10:29 PM
BINGO!!! You're absolutely right, i has it named .htaccess.txt. HUGE thanks to both of you!!!

pb&j
01-31-2004, 10:35 PM
good news :waving:

BulbaGrrrl
01-31-2004, 10:38 PM
Oh wait, I didn't see that bottom part u wrote. I uploaded it in binary cause when I upload it in ASCII I can't see the file so I can't Chmod it. It's working though, so binary should be OK right?

pb&j
01-31-2004, 10:41 PM
if it works... go with the flow.
:D