Regex redirect only for some matches
-
I have the following regex:
^/wp-content/uploads/(2018/10/|2018/11/|2018/12/|2019/01/)(.*)
https://www.mydomain.com/wp-content/uploads/$1It works for all except the “2018/10/” version of url (tested at httpstatus.io):
https://www.mydomain.com/wp-content/uploads/2018/10/my-file.jpg 404
https://www.mydomain.com/wp-content/uploads/2018/11/my-file.jpg 301 200
https://www.mydomain.com/wp-content/uploads/2018/12/my-file.jpg 301 200
https://www.mydomain.com/wp-content/uploads/2019/01/my-file.jpg 301 200I’ve also tried using only the “2018/10/” in the regex with no luck:
^/wp-content/uploads/2018/10/(.*)
https://www.mydomain.com/wp-content/uploads/$1We don’t have any page cache installed.
In your settings I have “Redirect Cache” set to “Never Cache”.Any idea what can be the problem?
Could it be a previous regex which is cached somewhere even though the setting say it should not cache?
- The topic ‘Regex redirect only for some matches’ is closed to new replies.