redirect - Regex with HttAccess

admin2025-04-18  0

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?

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1744931586a275188.html

最新回复(0)