需要重定向的.htaccess帮助 [英] .htaccess help needed for redirects

查看:183
本文介绍了需要重定向的.htaccess帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能重定向这两个网址的回 /博客/ 并覆盖任何变化还包括?PAGE_ID 作为第一个和 no_redirect 对于第二个。

How can I redirect both these URL's back to /blog/ and covering any variations that also include ?page_id for the first one and no_redirect for the second one.

  • https://www.example.com/blog/page/10/?page_id=%2Ffeed%2Fatom%2F

  • https://www.example.com/blog/page/10/?no_redirect=true

鸭preciate的帮助!

Appreciate the help!

推荐答案

尝试:

RewriteEngine on

RewriteCond %{THE_REQUEST} /blog/page/10/\?page_id=%2Ffeed%2Fatom%2F [NC,OR]

RewriteCond %{THE_REQUEST} /blog/page/10/\?no_redirect=true [NC]
RewriteRule ^ /blog/? [L,R]

编辑:

这里是另一种方式来重定向一切/博客/页之后/ *到/博客/

here is an another way to redirect everything after the /blog/page/* to /blog/

RewriteEngine on
RewriteCond %{THE_REQUEST} /blog/page/ [NC]
RewriteRule ^ /blog/? [L,R]

这篇关于需要重定向的.htaccess帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆