PDA

View Full Version : HTACCESS ALL THE INFO PLEASE


pearce6
09-27-2001, 07:07 AM
ok how do i set it up so all my pics are protected>


please a step by step help would be cool :)

RaiDeN
09-27-2001, 07:14 AM
> Make a ssh login:

> type "mc" (it starts a sort of commander)

> then in you picture dir do "touch .htacces" on the commandline

> select the file and press F4

> then copy this in it>

AuthUserFile /dev/null
AuthGroupFile /dev/null

DirectoryIndex index.html index.htm index.shtml index.cgi
ErrorDocument 404 http://www.yoururl.com

RewriteEngine On

RewriteCond %{HTTP_REFERER} !^http://www.yoururl.com.* [NC]
RewriteCond %{HTTP_REFERER} !^http://yoururl.com.* [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yoururl.com:80.* [NC]
RewriteCond %{HTTP_REFERER} !^http://yoururl.com:80.* [NC]

RewriteRule /* http://www.yoururl.com [R,L]

> then press F10 and save it.

it should work properly

hope it helps

pearce6
09-27-2001, 07:16 AM
stuck on the first bit "Make a ssh login:"

RaiDeN
09-27-2001, 07:20 AM
ask your host to do this then

if you dont know how to do that, you probably do not want SSH login.

just copy past it and tell them to do it. it wouldn't be much of a big deal for them

XM
09-27-2001, 10:36 AM
Not necessary. Open any text editor (notepad), copy that code into it and save as .htaccess . If you can't save it under this name give it any name you want, then transfer into desired directory on the server using FTP client and then rename it to .htaccess . Most FTP clients offer commands like rename etc...
Done. Just don't forget to change www.yoururl.com (http://www.yoururl.com) in the code to your url :)
XM

FreeNetPass Dave
09-27-2001, 11:33 AM
In case you are still a little confused I will paste the detailed instructions that we have in our webmaster resources regarding htaccess. If you are not using FNP just replace the "FNP" with whatever avs system you are using or the name of your site. Hope this helps:

1. SAMPLE:

AuthUserFile /dev/null
AuthGroupFile /dev/null

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com [NC]
RewriteCond %{HTTP_REFERER} !^http://yoursite.com [NC]
RewriteCond %{HTTP_REFERER} !^http://www.freenetpass.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://freenetpass.com/ [NC]
RewriteRule /* http://www.YOURSITE.com [R,L]

DO NOT use Front Page or other html editors for this.

2. In the 4th and 5th lines of the code you will see your "homepage" url. In one of these lines you will need to add or take away the "www.", depending on how it is now. For example, if your homepage url is http://www.sex.com in the 4th and 5th lines, you need to go to the 5th line and take out the "www." so it is just http://sex.com.

3. The 6th and 7th lines in the body of the code are basically saying that if the person is coming from freenetpass.com, they can access your members area. Any surfer that enters a valid username and password in the FNP script will be referred to your members area and will be coming from FNP. Therefore, to have your sites accessible for FNP surfers, you need the 6th and 7th lines. You may add as many lines as you wish if you have other referring urls to the members area. Just add their urls in the code also and any surfers coming from those urls will be able to access your members area. The last line is where you want to send an illegal referrer, meaning someone coming from somewhere OTHER than freenetpass or the urls you have designated. This should be your main site or a banner farm for example.

4. Once you have fixed the .htaccess file to match your preferences, ftp it to the directory that you want to protect (eg: /members).
IMPORTANT NOTE: Windows will most likely not let you rename the file to ".htaccess", so you will have to do this after uploading the file. After uploading, be sure to rename the file to .htaccess or the code will not work.

5. To test your .htaccess enter your site through your FNP script or from your site manager. If you can view your members area, all is working fine. Then close all of your browser windows and type in your members content area directly. If you get kicked to your homepage url your htaccess is working great!

RaiDeN
09-27-2001, 12:04 PM
you might wanna delete the 2 freenetpass frases. otherwise anyone coming from that site will have acces

only put your own dom,ains in there, or any other domains you wanna grant access

Jorge
09-27-2001, 12:07 PM
I could add: upload in ASCII mode; if you have a dedicated IP, add it to the list of "domains".

RaiDeN
09-27-2001, 12:17 PM
true guys. but he seems failry new....

what happens when he tries to upload it. (in ascii) then renames it and BAM lost his file.

this happens a lot because files with a "dot"in front are standard "hidden"" files on most hosting companies. so he wil freak. tries again. eventually fuck something up, and has to pay for support...

but when he now knows his file will be hidden (90% of the times) once renamed, he'll be allright :rolleyes: :D

shunga
09-27-2001, 12:47 PM
Originally posted by RaiDeN:
<STRONG>he seems failry new....</STRONG>

That depends on which name he's using this week. ;)