.htaccess htaccess将整个域重定向到另一个域,但对特定url进行自定义重定向

.htaccess htaccess将整个域重定向到另一个域,但对特定url进行自定义重定向,.htaccess,url-redirection,.htaccess,Url Redirection,我需要为域做一些重定向 基本上我需要的解释如下 将整个domain.net重定向到domain.com,但保留自定义重定向,如下所示: domain.net/specific_url.html to domain.com/my_new_url.html 你可以试试这个 RewriteCond %{HTTP_HOST} ^(www\.)?example\.net RewriteRule ^(.*)$ http://example.com [R=301,L] RewriteCond %{HTTP_

我需要为域做一些重定向

基本上我需要的解释如下

将整个domain.net重定向到domain.com,但保留自定义重定向,如下所示:

domain.net/specific_url.html to domain.com/my_new_url.html
你可以试试这个

RewriteCond %{HTTP_HOST} ^(www\.)?example\.net
RewriteRule ^(.*)$ http://example.com [R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.)?example\.net
RewriteRule ^specific_url/? http://example.com/new_url [R=301,L]

第一部分工作。。。(重定向所有域),但异常(特定url)无法正确重定向。我正在尝试一些修改…好的。我只需将第二个条件和规则置于第一个条件和规则之上。