.htaccess - 每个页面的子域重定向到主域
问题描述
我需要将子域页面重定向到主域上的新页面。重定向主页的最后一行中断了所有前一页重定向。它像这样重写它:
https://www.example.org/debt-help/do-debt-management-plans-work
代替
https://example.org/get-out-of-debt/
但是只有当 #redirect 主页添加到 htaccess 时它才会中断
RewriteCond %{HTTP_HOST} ^debthelp\.example\.org [NC]
RewriteRule ^do-debt-management-plans-work/(.*)$ https://example.org/get-out-of-debt/$1 [L,R]
RewriteCond %{HTTP_HOST} ^debthelp\.example\.org [NC]
RewriteRule ^how-to-manage-your-debt/(.*)$ https://example.org/get-out-of-debt/$1 [L,R=301]
#redirect the homepage and 404s
RewriteCond %{HTTP_HOST} ^debthelp\.example\.org [NC]
RewriteRule ^(.*)$ https://example.org/debt-help/$1 [L,R]
它似乎在过去起作用。服务器设置是否会通过更新影响这一点?它也是一个运行 w3c 总缓存的 wordpress 站点。我们正在逐步淘汰多站点并将内容移至主站点。我不清楚 apache 文档。
解决方案
推荐阅读
- java - 当我在 jTextField1 中输入一个数字时,案例没有得到处理
- python - Open3D - 用多边形体积裁剪点云
- python - 在 Pygame 中难以让精灵移动
- python - 将值附加到 json 文件中的列表中
- c# - 是否有一种模式或推荐的方式来等待一个通用值来实现某个值?
- mysql - 我想从 mysql db 更新我的表中的一个字段 - 但问题陈述在正文中如下所示
- javascript - Mongodb - 在单个结果中从多个集合中获取所有内容
- python - Getting a key error while formatting a stringified dictionary in python
- powershell - 用按键停止 powershell
- talend - 使用 Talend 循环遍历 .csv 文件