我需要为我的IP创建规则。
我有一个将所有流量重定向到临时域的规则,然后我需要创建一个新规则,让wordpress对我来说很好(永久链接会遇到问题,因为我更改了htaccess以重定向人员。
这是我的代码:
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]
我需要将第一个块与第二个块混合才能正常工作。 任何帮助灵魂?
答案 0 :(得分:0)
不确定我是否完全接受了您的问题,但我认为这可能是您所寻求的:
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]