0

I have the following .htaccess/regex_

RewriteCond %{HTTP_HOST} ^img.test.com$ [NC]
RewriteCond %{REQUEST_URI} ^\/([1-9]|1[0-2])\/(.*-?)\d{13}-([1-9]|1[0-2]{1})_ico.jpg
RewriteRule   ^(.*) $1 [R=301]

My matching URL is http://img.test.com/12/this-is-a-test-690-cable-1234567891234-12_ico.jpg which should result in 3 captured groups

  • Group 1. 1-3 12
  • Group 2. 4-29 this-is-a-test-690-cable-
  • Group 3. 43-45 12

How can I access those groups? $1 returns the full match and $2 returns http://img.test.com/.

Chris
  • 4,255
  • 7
  • 42
  • 83

0 Answers0