4images Forum & Community

4images Issues / Ausgaben => Installation, Update & Configuration => Topic started by: TheRiver on July 22, 2002, 04:40:47 PM

Title: Verzeichnisschutz ?!
Post by: TheRiver 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
Title: Verzeichnisschutz ?!
Post by: Jan 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
Title: Verzeichnisschutz ?!
Post by: Ingo_col on July 22, 2002, 07:15:39 PM
Bei Kontent kann man keine .htaccess Datei installieren!
Title: Verzeichnisschutz ?!
Post by: Mec4D 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/
Title: Verzeichnisschutz ?!
Post by: giffy007 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
Title: Verzeichnisschutz ?!
Post by: Jan on July 24, 2002, 08:15:51 AM
See the posting of Mec4D above. He says the same as me.

Jan
Title: Verzeichnisschutz ?!
Post by: giffy007 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
Title: Verzeichnisschutz ?!
Post by: Jan 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
Title: Verzeichnisschutz ?!
Post by: Mec4D 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:

(http://www.mec4d.com/noaccess.gif)
Title: Verzeichnisschutz ?!
Post by: giffy007 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:
Title: Put the total number of members in your templates.
Post by: Mec4D 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.
Title: Verzeichnisschutz ?!
Post by: giffy007 on July 24, 2002, 08:01:50 PM
Thanks Miss Mec4D  that works fine for me

Giffy
Title: Wohin mit der .htaccess-Datei?
Post by: kaffeetrinker71 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
Title: Verzeichnisschutz ?!
Post by: Jan on August 18, 2002, 01:15:16 PM
Eigene .htacces ins data-Verzeichnis.

Jan
Title: .htaccess problem
Post by: Dmitro 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
Title: Re: .htaccess problem
Post by: Dmitro on September 15, 2002, 02:14:42 PM
Quote from: Dmitro

I created the .htaccess. It works, of course, except that


this .htaccess file doesn't allow any images on my own website either, which is not exactly what I need.  :(

Is that how it should work, or something is wrong?

Dmitry
Title: Verzeichnisschutz ?!
Post by: Mec4D on September 15, 2002, 03:51:49 PM
I don't know, maybe try to change the extentions to small in place of JPG use just small jpg and try again.

I know that some members that used another Browser have problem to view images from the gallery, but with I.E and Net. was really no problems, people that use winXP have the same problem that don't allow them to view any images too. So after this all I don't use this for protect my images anymore and only for zip files and works great too for all.
Title: .htaccess
Post by: Dmitro on September 15, 2002, 04:26:44 PM
Thanks for a quick reply.
I see. Then I better don't use it either.
I use Win.2000 and both Netscape and Explorer to check my website. Now I am looking for the way to protect the data from being ripped away.
Dmitry
Title: Jetzt hab ich da noch eine Frage zu .htaccess
Post by: kaffeetrinker71 on December 31, 2002, 10:45:26 AM
Hi!
Wenn ich die .htaccess-Datei wie empfohlen in mein data-Verzeichnis setze, wird in der Galerie NUR noch das noaccess-Bild angezeigt. Selbst die Thumbnails...  :(
Ich hab sie dann mal in das data/media-Verzeichnis gesetzt (vorher den Pfad in der .htaccess angepasst).
Nun waren die Thumbnails alle korrekt zu sehen.
Aber die eigentlichen Bilder nicht!
Muss ich jetzt für jeden ID-Ordner (also data/media/10 usw.) eine .htaccess erstellen?

Bislang sieht meine .htaccess so aus:
Code: [Select]
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://echtbloed.de/4images/data/media/ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.echtbloed.de/4images/data/media/ [NC]
RewriteRule [^/]+.(gif|jpg|png|zip|mp3|swf|pdf|txt|mpg|mpeg|mov)$ http://www.echtbloed.de/4images/noaccess.gif [R,L]
Title: Verzeichnisschutz ?!
Post by: Jan on December 31, 2002, 11:09:44 AM
Trage als URL nur http://echtbloed.de ein, nicht http://echtbloed.de/4images/data/media/

Jan
Title: Verzeichnisschutz ?!
Post by: kaffeetrinker71 on December 31, 2002, 02:21:03 PM
Ich liebe dieses Forum....

Noch nie habe ich einen so schnellen Support gesehen!  :D

Ich wünsche einen guten Rutsch!!!!
Title: Verzeichnisschutz ?!
Post by: Dmitro on December 31, 2002, 04:25:48 PM
Vielen Dank
Title: .htaccess Problem
Post by: tatanka on April 08, 2003, 11:54:50 AM
Hallo

Ich habe diese Zeilen in eine .htaccess-Datei geschrieben und diese dann im Verzeichnis /data/ abgelegt.

------------------------------------------------
Code:

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

Alles ist i.O. Doch nun können die Bilder nicht angezeigt werden. Weil diese ja eben geschützt sind.
Wie kann ich also verhidern, dass jemand von einem Ort aus einen direkten Linkaufruf meiner Bilder machen kann?


Gruss

tatanka