htaccess的 - 创建一个特定的IP规则? [英] htaccess - create a rule for a specific IP?

查看:136
本文介绍了htaccess的 - 创建一个特定的IP规则?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为我的IP规则。

I need to create a rule for my IP.

我有一个规则,真实重定向所有TRAFIC到一个临时域,然后我需要创建一个新的规则制定字preSS为我工作正常(固定链接越来越问题,因为我改变了htaccess的重定向的人。

I have a rule that's redirecting all the trafic to a temporary domain, and then I need to create a new rule for making wordpress works fine for me (the permalinks are getting problems because I changed the htaccess to redirect people.

这是我的code:

RewriteEngine on
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REMOTE_HOST} !^95.126.000.MYIP
RewriteRule $ http://www.tempraldomain.com [R=302,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

我需要混合第一块与第二正常工作。 任何帮助的灵魂?

I need to mix first block with the second to work properly. Any helping soul?

推荐答案

不知道我完全搞定你的问题,但我认为这可能是你想找的:

Not sure I get your question completely, but I think this might be what your looking for:

RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REMOTE_ADDR} !^95\.126\.000\.MYIP$
RewriteRule $ http://www.tempraldomain.com [R=302,L]


RewriteCond %{REMOTE_ADDR} ^95\.126\.000\.MYIP$
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

这篇关于htaccess的 - 创建一个特定的IP规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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