[英].htaccess, redirect website but with exceptions
I am redirecting an entire website, with a few exceptions. 除了少数例外,我正在重定向整个网站。 I have the following rules and conditions in place:
我有以下规则和条件:
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
#RewriteCond %{HTTP_HOST} !^loans\.myoldwebsite\.com$ [NC]
#RewriteCond %{HTTP_HOST} !^client\.myoldwebsite\.com$ [NC]
#RewriteRule ^(.*)$ https://www.mynewwebsite.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} !^(client|loans)\.myoldwebsite\.com$ [NC]
RewriteRule ^(.*)$ https://www.mynewwebsite.com/$1 [L,NE,R=302]
But I also need to make sure that http://www.myoldwebsite.com/getLead.php
is ignored as well, so it doesn't get redirected. 但是我还需要确保也忽略了
http://www.myoldwebsite.com/getLead.php
,因此它不会被重定向。
You can have multiple RewriteCond
s: 您可以具有多个
RewriteCond
:
RewriteCond %{HTTP_HOST} !^(client|loans)\.myoldwebsite\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/getLead.php$
RewriteRule ^(.*)$ https://www.mynewwebsite.com/$1 [L,NE,R=302]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.