htaccess维护页面重定向会导致“太多重定向”,导致错误 [英] htaccess maintenance page redirect results in "too many redirects" error

查看:126
本文介绍了htaccess维护页面重定向会导致“太多重定向”,导致错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:为什么以无限循环结尾? (这个想法是转发除1外的所有IP)。

This is my code: why does this end in a infinite loop? (the idea was to forward all IP's except 1).

RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} !=91.198.106.118
RewriteCond %{REQUEST_URI} !^/page\.html$
RewriteRule ^(.*)$ http://domain.nl/i/page.html [R=307,L]


推荐答案

将此代码放入您的.htaccess:

Put this code in your .htaccess:

Options -MultiViews +FollowSymLinks
RewriteEngine On

RewriteCond %{REMOTE_ADDR} !=91.198.106.118
RewriteRule ^(?!i/page\.html).*$ http://domain.nl/i/page.html [R=307,L,NC]

这篇关于htaccess维护页面重定向会导致“太多重定向”,导致错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆