Apache 301将所有页面重定向到新站点(1目录除外)
我试图创建一个301重定向所有网页,但一个目录到一个新的网站,但我有麻烦设置它 这基本上就是我需要的: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
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]