我有点卡住了。我在.htaccess 中有以下重定向
Redirect http://www.domain1.com http://www.domain2.com/subdomain=
尽管我希望,如果有人键入www.domain1.com/1234,它会在重定向时自动将12345附加到重定向URL,这样它就会转到www.domain2.com/subdomain=1345。
即它们附加到原始重定向的任何内容都将被附加到新重定向(之前没有/)。
您应该使用RedirectMatch
而不是Redirect
。参见手动
资源已移动到另一个服务器
#With RedirectMatch RedirectMatch "^/docs/(.*)" "http://new.example.com/docs/$1"
在您的情况下:
RedirectMatch ^/(.*)$ http://www.domain2.com/subdomain=$2