【发布时间】:2016-09-01 07:27:49
【问题描述】:
我的主要 example.com 中有许多子域,例如 us.example.com、gb.example.com、fr.example.com、pl.example.com 等。
现在我需要从不存在的站点到新站点的 301 重定向。通常我会以最简单的方式做到这一点:
Redirect 301 /system_example/systems/system_abc.html http://pl.example.com/system_example/systems/all_systems.html
但这在我拥有的网站结构中是不可能的,因为具有该路径 /system_example/systems/system_abc.html 的所有其他子域现在将重定向到 http://pl.example.com/system_example/systems/all_systems.html
我只想在 pl.example.com 子域中进行重定向 - 所有其他的都需要保持不变。如果只有这种类型的重定向有效但无效:
Redirect 301 http://pl.example.com/system_example/systems/system_abc.html http://pl.example.com/system_example/systems/all_systems.html
是否有可能通过 .htaccess 实现这一目标?
【问题讨论】:
-
所以,这个模式应该适用于所有子域还是只适用于
pl.example.com? -
目前只有一个子域。它应该少这样工作:Redirect 301 pl.example.com/system_example/systems/system_abc.html pl.example.com/system_example/systems/all_systems.html
标签: .htaccess subdomain url-redirection