作者: tyc00 時間: 2013-9-9 15:18 標題: 求教Apache2 mod_rewrite 禁止圖片外連安裝方法
本帖最後由 tyc00 於 2013-9-9 15:20 編輯
求各位師兄請點小弟
原本諗住裝mod_rewrite,裝完restart出現下圖
[attach]1578212[/attach]
網上search過話表示模塊是內建的,不用再調入,註釋掉
#LoadModule rewrite_module modules/mod_rewrite.so
但係係.htaccess用RewriteEngine on 圖片禁止外連都係無效,第二個網站照出到圖
- DirectoryIndex .htaccess
- SetHandler Gallery_Security_Do_Not_Remove
- Options None
- <IfModule mod_rewrite.c>
- RewriteEngine on
- RewriteCond %{HTTP_REFERER} !^$
- RewriteCond %{HTTP_REFERER} !^http://(www.)?xxxxx.com.*$ [NC]
- RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://xxxx.com/email.png [R,NC,L]
- </IfModule>
試過 .htaccess 亂打d野 500 Internal Server Error
原本httpd.conf
- <Directory />
- Options FollowSymLinks
- AllowOverride all
- Order deny,allow
- Deny from all
- </Directory>
/var/www
是否需要改成 ??
- <Directory /var/www>
- Options FollowSymLinks
- AllowOverride all
- Order deny,allow
- Deny from all
- </Directory>
