Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
.htaccess 重定向根文件夹,但不重定向子文件夹_.htaccess_Redirect_Url Redirection - Fatal编程技术网

.htaccess 重定向根文件夹,但不重定向子文件夹

.htaccess 重定向根文件夹,但不重定向子文件夹,.htaccess,redirect,url-redirection,.htaccess,Redirect,Url Redirection,我只想将我的网站www.example.com的根目录重定向到www.example2.com 但不是子文件夹www.example.com/subfolder! 可能吗 例如。 以下规则重定向所有“我的网站”: Redirect 301 / http://www.example2.com 要仅重定向根,可以使用以下命令 RedirectMatch 301 ^/$ http://example2.com/

我只想将我的网站www.example.com的根目录重定向到www.example2.com 但不是子文件夹www.example.com/subfolder! 可能吗

例如。 以下规则重定向所有“我的网站”:

Redirect 301 / http://www.example2.com

要仅重定向根,可以使用以下命令

RedirectMatch 301 ^/$ http://example2.com/