【发布时间】:2021-05-10 04:40:48
【问题描述】:
我在这里浏览了很多不同的帖子,但没有任何运气。
我有两个网站(例如):exampledomain.com 和 mb.exampledomain.com
如果用户访问 mb.exampledomain.com 并且 URL 不 包含字符串“retreat”,那么我想将他们重定向到 exampledomain.com 而维护蛞蝓。
所以:
mb.exampledomain.com/retreat(或)mb.exampledomain.com/retreat_sunday 应该可供用户正常访问
mb.exampledomain.com/(或)mb.exampledomain.com/about-us 应分别重定向到 exampledomain.com/(或)exampledomain.com/about-us。
我需要通过在目录根目录的 .htaccess 文件中使用规则来实现这一点。
此外,htaccess 规则不应影响 mb.exampledomain.com/retreat 页面上资产文件的可访问性。
感谢您提供的任何帮助!
【问题讨论】:
标签: wordpress apache .htaccess mod-rewrite