最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

htaccess - 301 redirect any RSS feed on level up url

programmeradmin1浏览0评论

On my site I've got RSS feeds - something like this:

  • www.example/en/shipper/feed/
  • www.example/en/carrier/feed/

I want to 301 redirect all those URLs to the level up, respectively:

  • www.example/en/shipper/
  • www.example/en/carrier/

On my site I've got RSS feeds - something like this:

  • www.example/en/shipper/feed/
  • www.example/en/carrier/feed/

I want to 301 redirect all those URLs to the level up, respectively:

  • www.example/en/shipper/
  • www.example/en/carrier/
Share Improve this question edited Jul 10, 2020 at 13:59 MrWhite 3,8911 gold badge20 silver badges23 bronze badges asked Jul 10, 2020 at 11:34 pitecpitec 112 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

So to redirect /en/shipper/feed/ to /en/shipper you should be able to add this in your root .htaccess. You'll have to make sure you put it in the right place so that it gets matched before any other Rewrite rules - putting it at the top of the list of RewriteRule's should be fine.

These rules assume that you have a standard Wordpress .htaccess with RewriteBase /

RewriteRule ^en/shipper/feed/$ /en/shipper/ [R=301,L]
RewriteRule ^en/carrier/feed/$ /en/carrier/ [R=301,L]

I tested a similar rule in a test setup and it works for me.

发布评论

评论列表(0)

  1. 暂无评论