Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache htaccess重定向以/ee开头的所有页面_Apache_.htaccess_Redirect - Fatal编程技术网

Apache htaccess重定向以/ee开头的所有页面

Apache htaccess重定向以/ee开头的所有页面,apache,.htaccess,redirect,Apache,.htaccess,Redirect,我想将所有用户从/ee重定向到另一个域示例: 到 我试过了 <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.example1\.com/ee$ RewriteRule (.*)$ https://www.example2.com [R=301,L] </IfModule> 重新启动发动机 重写cond%{HTTP_HOST}^www\.example1\.

我想将所有用户从/ee重定向到另一个域示例: 到

我试过了

 <IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^www\.example1\.com/ee$
  RewriteRule (.*)$ https://www.example2.com [R=301,L]
 </IfModule>

重新启动发动机
重写cond%{HTTP_HOST}^www\.example1\.com/ee$
重写规则(.*)$https://www.example2.com [R=301,L]

但它不能与“/”一起工作。谢谢。

您的url中的
/ee
url路径。要检查URL路径,需要根据
%{REQUEST\u URI}
变量而不是
%{HTTP\u HOST}
进行匹配

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example1\.com$
RewriteCond %{REQUEST_URI} ^/ee
RewriteRule (.*)$ https://www.example2.com [R=301,L]