首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >重定向除一个查询字符串外的所有URL

重定向除一个查询字符串外的所有URL
EN

Stack Overflow用户
提问于 2012-09-03 08:01:04
回答 2查看 314关注 0票数 0

我有两个域mcleancenter.orgaldentheatre.org,它们都指向一个目录。我想将没有"alden-theatre"的所有"alden-theatre"重定向到mcleancenter.org。所有在URLs中有URLs的URL都应该重定向到aldentheatre.org

例如:

  • /about应该重定向到mcleancenter.org/about
  • /contact应该重定向到mcleancenter.org/contact
  • /alden-theatre应该重定向到aldentheatre.org/alden-theatre
  • /alden-theatre/perfomance应该重定向到aldentheatre.org/alden-theatre/perfomance

任何帮助都是非常感谢的。

EN

回答 2

Stack Overflow用户

发布于 2012-09-03 08:15:10

你用的是哪台服务器?

在任何情况下,您都可以将Apache服务器作为代理“放在”您使用的任何服务器之前。然后可以使用雷克威尔特重定向请求。

票数 0
EN

Stack Overflow用户

发布于 2012-09-03 08:55:34

因为所有的urls都重定向到mcleancenter.org

代码语言:javascript
复制
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^alden-theatre(.*) http://www.aldentheatre.org/alden-theatre$1 [R]

希望这能帮上忙

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12244025

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档