rewrite重定向:使用Apache的rewrite功能实现内部重定向来源: 发布时间:星期日, 2009年1月4日 浏览:61次 评论:0
场景:实验室有
![]() ![]() ![]() ![]() ![]() ![]() 实现方案 使用iptables ![]() 使用ipfilter ![]() 使用apache ![]() 优缺点: 思路方法1和2 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 思路方法3是我推荐 ![]() ![]() ![]() ![]() ![]() 实现细节 这里给出我对两种方案 ![]() ![]() ![]() ![]() iptables -A INPUT -p tcp --dport 8080 -j ACCEPT iptables -A FORWARD -p tcp --destination-port 80 --destination 10.20.10.204 -j ACCEPT iptables -t nat -A PREROUTING -d 1.2.3.4 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.20.10.204:80 iptables -t nat -A POSTROUTING -s 10.20.10.0/8 -d 10.20.10.204 -p tcp -m tcp --dport 80 -j SNAT --to-source 10.20.10.208 不知道什么原因 ![]() ![]() ![]() ![]() 对于apche ![]() ![]() ![]() ![]() 在这里我们假定 DocumentRoot "/var/www/html" ServerRoot "/etc/httpd" 1) /etc/httpd/conf/httpd.conf 文件 # 加载 rewrite 模块 LoadModule rewrite_module modules/mod_rewrite.so # 允许符号连接和覆盖 ![]() Options FollowSymLinks AllowOverride All # 允许符号连接和覆盖 ![]() Options FollowSymLinks AllowOverride All Order allow,deny Allow from all 2) 在 /var/www/html 下新建 .htaccess 文件 ![]() RewriteEngine _disibledevent=_blank>http://nat_server/forum来访问web_server上面提供 ![]() ![]() 0
相关文章
读者评论发表评论 |