我希望将所有请求重定向到
*.exapmle.com/foo/bar?moo=soo TO exapmle.net/foo/bar?moo=soo
例如
www.exapmle.com/foo/bar?moo=soo TO exapmle.net/foo/bar?moo=soo
或
exapmle.com/foo/bar?moo=soo TO exapmle.net/foo/bar?moo=soo
如何处理htaceess文件?
答案 0 :(得分:0)
我如何将[wildcard] .exapmle.com / [wildcard2]重定向到example.net/ [wildcard2],例如s1.example.com/content/1?from=test到example.net/content/1?from =测试
将以下内容添加到exapmle.com网站根目录中的.htaccess
文件
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} exapmle\.com$ [NC]
RewriteRule ^ http://exapmle.net%{REQUEST_URI} [L,R=301]