Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的 WordPress 多站点中,我需要将我的子站点主页重定向到不同的页面。像 site.com/subsite 或 site.com/subsite/ 应该重定向到 site.com/subsite/home/ 。
重定向 301 可以做到这一点,但它也会将 site.com/subsite/search?q=param1 重定向到 site.com/subsite/home/search?q=param1 。但它不应该。wp_redirect 也会这样做。
谢谢
您想RedirectMatch改用:
RedirectMatch
RedirectMatch 301 ^/subsite/?$ /subsite/home/