Author Topic: Verzeichnisschutz ?!  (Read 23686 times)

0 Members and 1 Guest are viewing this topic.

Offline TheRiver

  • Pre-Newbie
  • Posts: 9
    • View Profile
Verzeichnisschutz ?!
« on: July 22, 2002, 04:40:47 PM »
Hallo,
'bin mal ein paar Seiten hier durchgegangen und habe festgestellt das bei einigen das "Data" Verzeichniss nicht gesützt ist!

Wie kann mann verhindern das darauf zugegriffen wird? Ich bin bei Kontent und da geht nur kompett .htacces und wenn ich es so mache, kommt beim aufruf des Albums immer die Passwortabfrage:( Ich möchte erreichen das wenn man 4images/data aufruft eine seite kommt: Datei nicht gefunden oder Verboten...irgendwie so!

Gruß
Jörg

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Verzeichnisschutz ?!
« Reply #1 on: July 22, 2002, 05:36:32 PM »
Hi,

probiere es mal mit folgender .htaccess:

Code: [Select]
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://deineurl.de [NC]
RewriteCond %{HTTP_REFERER} !^http://www.deineurl.de [NC]
RewriteRule [^/]+.(.*)$ http://www.deineurl.de/accessdenied.gif [R,L]


Die letzte Zeil kann z.B. auch so geschrieben werden:
Code: [Select]
RewriteRule [^/]+.(gif|jpg|png)$ http://www.deineurl.de/accessdenied.gif [R,L]
Dann werde nur Dateien mit der Endung gif, jpg und png geschützt.

"deineurl.de" muss natürlich entsprechend ersetzt werden.

Gruß Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Ingo_col

  • Newbie
  • *
  • Posts: 26
    • View Profile
Verzeichnisschutz ?!
« Reply #2 on: July 22, 2002, 07:15:39 PM »
Bei Kontent kann man keine .htaccess Datei installieren!

Offline Mec4D

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://www.mec4d.com
Verzeichnisschutz ?!
« Reply #3 on: July 24, 2002, 03:57:51 AM »
I ad new extension to my .htaccess and nobody can download other files as jpg or gif or link to this files outside my server.
You can protect only the directory that you wish and not the whole website.
Code: [Select]

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://your_domain/data/ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.your_domain/data/ [NC]
RewriteRule [^/]+.(gif|jpg|png|zip|pdf|txt|mpg|mpeg|mov)$ http://www.your_domain/noaccess.gif [R,L]


check self for example with zip files
http://www.mec4d.com/gallery/data/media/20/taibo.zip
you  can't download the zip files from here but well when you are on the website server where is the url to download so you have all under controle and nobody will download anything if you don't allow via the admin panel..
---------------------------------------------------------------------------------

You can also install for the data/media a tracking script
For latest version and help files, visit:
   http://www.xav.com/scripts/axs/

and this will looks like this:

http://www.mec4d.com/gallery/data/media/
Catharina

Offline giffy007

  • Full Member
  • ***
  • Posts: 119
    • View Profile
Verzeichnisschutz ?!
« Reply #4 on: July 24, 2002, 08:10:43 AM »
Hi Jan can you put this in English for us so we can see what to do ?


Giffy

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Verzeichnisschutz ?!
« Reply #5 on: July 24, 2002, 08:15:51 AM »
See the posting of Mec4D above. He says the same as me.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline giffy007

  • Full Member
  • ***
  • Posts: 119
    • View Profile
Verzeichnisschutz ?!
« Reply #6 on: July 24, 2002, 08:33:57 AM »
How do i do this ?, do i put this into the .htaccess file or some where else , i need help with is if some would be so kind thanks  :!:

Giffy

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Verzeichnisschutz ?!
« Reply #7 on: July 24, 2002, 09:21:31 AM »
Create a new .htaccess file with the code from above and put it into the data directory.

Greets Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Mec4D

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://www.mec4d.com
Verzeichnisschutz ?!
« Reply #8 on: July 24, 2002, 02:06:58 PM »
First I am not " He" I am " she" Jan!  :lol:


Code: [Select]

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://your_domain/data/ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.your_domain/data/ [NC]
RewriteRule [^/]+.(gif|jpg|png|zip|pdf|txt|mpg|mpeg|mov)$ http://www.your_domain/noaccess.gif [R,L]



giffy007

open your text editor, copy and paste the code above to your document, save all as .htaccess remember to change the domain name to your own, and upload the .htaccess to your data directory or where you wish to protect your files, upload then your image and all will work fine.

you can change the extension  gif|jpg|png|zip|pdf|txt|mpg|mpeg|mov
to your own, I ad so much for example to show you only the good idea.

you can also install the tracking on your server if you have access to the cgi-bin directory, the link to the script I wrote above in my least post.


If you need help with the .htaccess just write to cath@mec4d.com

here is image for you so you can upload to your directory for using with the code, you can imagine somebody that try to download your files and get setup , have fun! :lol:

Catharina

Offline giffy007

  • Full Member
  • ***
  • Posts: 119
    • View Profile
Verzeichnisschutz ?!
« Reply #9 on: July 24, 2002, 06:58:40 PM »
Thanks for the help , nice web site  Miss Mec4D  , i will try this . one question how did you get the total of actual members on the front page ? What part of the script do you use ,because we ask this question a while back and got no answer :!:  
We wanted to put the total number of members on our home template or in the online template so everybody can see how many members have joined , we could also use help with this !


Oh just found sorryhttp://www.4homepages.de/forum/viewtopic.php?p=4338&highlight=#4338

Thanks again

Giffy :wink:

Offline Mec4D

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://www.mec4d.com
Put the total number of members in your templates.
« Reply #10 on: July 24, 2002, 07:22:48 PM »
Thank you Giffy,

This idea was from Jan and if you see this works as well on my website.

Copy this code to you : "includes/page_header.php"

Code: [Select]
$sql = "SELECT COUNT(*) as total_users
        FROM ".USERS_TABLE."
        WHERE user_id <> ".GUEST;
$row = $site_db->query_firstrow($sql);
$site_template->register_vars("total_users", $row['total_users']);


Then you have to edit the template(s) and put there the {total_users} , you can do this from the admin panel as well.

In my situation I just ad the {total_users} in my all templates.

For example fragment from the Template ( home.html )

Code: [Select]

                    <tr>
                      <td class="head2" height="20"><img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{total_users} {lang_registered_user}</td>
                    </tr>
                   


Total users are only the actual number of members and you saw the effect already on my website how this looks out.
Catharina

Offline giffy007

  • Full Member
  • ***
  • Posts: 119
    • View Profile
Verzeichnisschutz ?!
« Reply #11 on: July 24, 2002, 08:01:50 PM »
Thanks Miss Mec4D  that works fine for me

Giffy

Offline kaffeetrinker71

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • http://www.echtbloed.de
Wohin mit der .htaccess-Datei?
« Reply #12 on: August 18, 2002, 01:05:05 PM »
Hi!
Wo muss denn der Code reingeschrieben werden?
In die normale .htaccess-Datei im Root-Verzeichnis oder muss ich eine extra .htaccess-Datei erstellen und in das /data-Verzeichnis schreiben?

Danke schon mal für die Antwort

Erfahrungsgemäß kommt die ja sehr schnell  :D
Der Kaffeetrinker
------------------------------
Ein Leben ohne Kaffee ist kein Leben... c(_)
------------------------------

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Verzeichnisschutz ?!
« Reply #13 on: August 18, 2002, 01:15:16 PM »
Eigene .htacces ins data-Verzeichnis.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Dmitro

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
.htaccess problem
« Reply #14 on: September 15, 2002, 01:48:13 PM »
Hi,

I created the .htaccess. It works, of course, except that it needs some tuning, which I don't know how to do.

My server error log tells:

.htaccess: RewriteRule: bad argument line '[^/]+.(gif|JPG|jpg|png|zip|JPEG)$'

Why the argument is bad, and what I have to do to correct it?

With thanks,

Dmitry
Regards,
Dmitry
____________________
www.violadabraccio.com