您的位置:首页 > 运维架构 > Apache

apache重定向

2013-05-24 11:24 260 查看
301重定向:域名重定向,URL更改
RewriteEngine on
RewriteCond %{http_host} ^juhuisuan.com [NC]
RewriteRule ^(.*)$ http://www.juhuisuan.com$1 [R=301,L]

内容重定向,URL不变
RewriteCond %{http_host} ^ad.pv25.com
RewriteRule ^(.*)$ /Index.php/Bidding/ [L]

非本域名禁止访问
SetEnvIfNoCase Referer "^http://www.juhuisuan.com" local_ref=1
<FilesMatch ".*(tongji|tongjim)$">
order Allow,Deny
Allow from env=local_ref
</FilesMatch>

禁止IP访问
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Deny from 101.226.129.182
Deny from 115.236.139.174
Deny from 122.225.98.78
</Directory>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息