redirect - Regex with HttAccess

I am trying to use a regex redirect for media, we had them on a cdn but we are moving them back to wordpress. ..........

I am trying to use a regex redirect for media, we had them on a cdn but we are moving them back to wordpress.

........../website/images/
/..../../
/
/
Replace:<br>
/

We want to have the 4 top directories redirect to the bottom one

we used this, but it did not work.

RewriteRule ^wp-content/uploads/2015/(.*)$ /wp-content/uploads/$1 [R=301,NC,L]
RewriteRule ^wp-content/uploads/2016/(.*)$ /wp-content/uploads/$1 [R=301,NC,L]
RewriteRule ^wp-content/uploads/2017/(.*)$ /wp-content/uploads/$1 [R=301,NC,L]
RewriteRule ^wp-content/uploads/2018/(.*)$ /wp-content/uploads/$1 [R=301,NC,L]
RewriteRule ^wp-content/uploads/2019/(.*)$ /wp-content/uploads/$1 [R=301,NC,L]

Any ideas?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744931564a4601770.html

相关推荐

  • redirect - Regex with HttAccess

    I am trying to use a regex redirect for media, we had them on a cdn but we are moving them back to wordpress. ..........

    2天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信