11

新しいサイトへの 1 つのディレクトリを除くすべてのページに対して 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]

しかし、 http://www.example.com/store にアクセスすると、 http://www.newdomain.com/storeに移動します

基本的に、ディレクトリ /store を古いドメインに残す必要があります。誰でも助けることができますか?.htaccess ルールの経験がない...

4

1 に答える 1