doulu1945 2015-06-03 09:19
浏览 45
已采纳

重写301重定向规则以将所有内容移至某个类别

Is it possible to create a rewrite rule to move everything up a category:

example:

from:

/category/second-category/product-name.html

/category/second-category/third-category/product-name.html

to:

/second-category/product-name.html

/second-category/third-category/product-name.html

I've changed the structure around and need to add 501 redirects and only know how to do per-one and don't fancy doing 200+.

  • 写回答

1条回答 默认 最新

  • doucuyu2259 2015-06-03 09:24
    关注

    You can use this rule in root .htaccess:

    RedirectMatch 301 ^/(?:cat1|cat2|cat5)/(.+?\.html)$ /$1
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容