Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.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 301将所有页面重定向到新站点(1目录除外)_Apache_.htaccess_Http Redirect - Fatal编程技术网

Apache 301将所有页面重定向到新站点(1目录除外)

Apache 301将所有页面重定向到新站点(1目录除外),apache,.htaccess,http-redirect,Apache,.htaccess,Http Redirect,我试图创建一个301重定向所有网页,但一个目录到一个新的网站,但我有麻烦设置它 这基本上就是我需要的: http://www.example.com/store => no redirects, users remain on http://www.example.com/store http://www.example.com/* => all other pages go to this url http://www.newdomain.com/ AKA http://www

我试图创建一个301重定向所有网页,但一个目录到一个新的网站,但我有麻烦设置它

这基本上就是我需要的:

http://www.example.com/store => no redirects, users remain on http://www.example.com/store
http://www.example.com/* => all other pages go to this url http://www.newdomain.com/

AKA

http://www.example.com/apple => http://www.newdomain.com/
http://www.example.com/pie => http://www.newdomain.com/
http://www.example.com/foo/bar => http://www.newdomain.com/
我试过这个方法:

RewriteEngine on
RewriteCond %{REQUEST_URI}!^/store/
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
但当我去的时候,我需要


基本上,我需要目录/存储保留在旧域上。有人能帮忙吗?无法体验.htaccess规则…

空间的经典案例,因为它不应该存在。谢谢
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/store
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]