|
|
|
| Пробовал так:
Order Allow,Deny
deny from all
allow from %{HTTP_HOST}
|
Пробовал и так:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} .*(jpg|jpeg|gif|png)$
RewriteRule .(jpg|jpeg|gif|png)$ - [F]
|
Запрет то работает. только и на сайте картинки не показываются.
Как разрешить показ на сайте, но запретить прямое скачивание. | |
|
|
|
|
|
|
|
для: kukuikar
(10.09.2009 в 13:29)
| | там в мауалах ещё такие примеры
<FilesMatch \.(?i:gif|jpe?g|png)$>
Order allow,deny
Deny from all
</FilesMatch>
|
или можно использовать
<Files> Directive
Description: Contains directives that apply to matched filenames
Syntax: <Files filename> ... </Files>
Context: server config, virtual host, directory, .htaccess
Override: All
Status: Core
Module: core
|
The <Files> directive limits the scope of the enclosed directives by filename. It is comparable to the <Directory> and <Location> directives. It should be matched with a </Files> directive. The directives given within this section will be applied to any object with a basename (last component of filename) matching the specified filename. <Files> sections are processed in the order they appear in the configuration file, after the <Directory> sections and .htaccess files are read, but before <Location> sections. Note that <Files> can be nested inside <Directory> sections to restrict the portion of the filesystem they apply to.
The filename argument should include a filename, or a wild-card string, where ? matches any single character, and * matches any sequences of characters. Regular expressions can also be used, with the addition of the ~ character. For example:
<Files ~ "\.(gif|jpe?g|png)$">
would match most common Internet graphics formats. <FilesMatch> is preferred, however.
Note that unlike <Directory> and <Location> sections, <Files> sections can be used inside .htaccess files. This allows users to control access to their own files, at a file-by-file level.
| |
|
|
|
|
|
|
|
для: kukuikar
(10.09.2009 в 13:29)
| | в чем отличие между прямым скачиванием и показом на сайте с точки зрения клиента http-протокола? | |
|
|
|
|
|
|
|
для: Trianon
(10.09.2009 в 15:02)
| | боюсь что никакой :( | |
|
|
|
|
|
|
|
для: Trianon
(10.09.2009 в 15:02)
| | В картинку HTTP_REFERER помоему передается, можно с ним придумать что-то. Защита от особо ленивых программеров получится. | |
|
|
|
|
|
|
|
для: Евгений Петров
(11.09.2009 в 00:11)
| | А в ссылку для скачивания, можно подумать, не передается | |
|
|
|
|
|
|
|
для: Trianon
(11.09.2009 в 01:00)
| | Можно все картинки передавать через php файл image.php?image=img/img1.jpg,
а в нем уже через GD отправлять картинку браузеру.
Но как тогда быть с css-файлом в котором есть метки с background-image:url(../img/bg2.png)?
Они то будут блокироваться апачем, не будут выведены в браузер... | |
|
|
|
|
|
|
|
для: Евгений Петров
(11.09.2009 в 00:11)
| | а если без реферера зашел?
с чистой страницы? | |
|
|
|
|