博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Apache相关配置记录
阅读量:6969 次
发布时间:2019-06-27

本文共 1714 字,大约阅读时间需要 5 分钟。

hot3.png

防盗链,主要根据访问来源 HTTP_REFERER 来判断是否来源本站,如果不是则返回设定的图片:
ServerAdmin tom@xxxxx.com DocumentRoot "/opt/app/php/xxxxx.img" ServerName img.xxxxx.com ServerAlias img.xxxxx.com ErrorLog "logs/img.xxxxx.com-error.log" CustomLog "/etc/httpd/logs/img.xxxxx.com.access.log" combined DirectoryIndex index.php index.html index.htm
Options FollowSymLinks AllowOverride All Order allow,deny Allow from all
Deny from all
RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://xxxxx.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://xxxxx.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.xxxxx.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.xxxxx.com$ [NC] RewriteRule .*\.(gif|jpg|png|swf)$ http://www.xxxxx.com/nolink.jpg [R,NC]

301重定向,老域名转向新域名,保持域名权重:

ServerAdmin tom@tom.com ServerName toooom.com ServerAlias www.toooom.com RedirectMatch Permanent ^/(.*) http://www.haolianduo.com/$1

安全配置,目录禁止执行php,exe,jsp等程序文件:
ServerAdmin tom@tom.com DocumentRoot "/opt/app/php/xxxxx.info" ServerName info.xxxxx.com ServerAlias info.xxxxx.com ErrorLog "logs/info.xxxxx.com-error.log" CustomLog "/etc/httpd/logs/info.xxxxx.com.access.log" combined DirectoryIndex index.php index.html index.htm
Options FollowSymLinks AllowOverride All Order allow,deny Allow from all
Deny from all
Deny from all

转载于:https://my.oschina.net/u/1175235/blog/356332

你可能感兴趣的文章
记录新机房建设。20130711
查看>>
主Makefile分析
查看>>
Java RMI之HelloWorld篇
查看>>
一张图看懂跨境电商的前世今生(附XMIND整理)
查看>>
NFS简要安装步骤与配置(debian/ubuntu)
查看>>
温度传感器+I2C+串口+PC上位机(pyserial)例子
查看>>
结合keepalived实现lvs的高可用群集故障自动转移
查看>>
JFreeChart绘制保存为图片
查看>>
GDI+ 学习记录(25): 变换 - Transform
查看>>
允许telnet 通过root用户进行访问
查看>>
WinAPI: waveOutGetNumDevs - 获取波形输出设备的数目
查看>>
一个Hadoop管理员的职责(翻译)
查看>>
mysql主从复制架构及实现
查看>>
Couchbase学习笔记(3)——.NET应用入门
查看>>
temp
查看>>
【分享】Java程序获取本机ip,mac,os名称,版本等
查看>>
nginx中没有绑定域名(ip访问)的处理办法
查看>>
单元测试工具——JUnit
查看>>
AVI RIFF 文件参考手册
查看>>
input添加星号*
查看>>