htaccess maintenance page redirect results in “too

2019-09-05 06:25发布

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
3条回答
做自己的国王
2楼-- · 2019-09-05 06:36

I think you should remove ^ from request_uri

查看更多
叼着烟拽天下
3楼-- · 2019-09-05 06:53

Assuming this is the same domain, you're redirecting everything to /i/page.html except /page.html. Strip out /i/page.html instead.

查看更多
在下西门庆
4楼-- · 2019-09-05 07:01

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]
查看更多
登录 后发表回答