regex - Match last occurence of 4 digits htaccess rewrite -
i'm wondering sort of regex use match last occurence of set of 4 digits in url.
my url being formatted this
/artist/album-4 digits-extra stuff
in url, "4 digits" last possible occurence of 4 digits together. thing album may contain sets of 4 digits, needs match last occurrence in url.
basically need rewrite rule act follows
rewriterule ^(.*)/(.*)-(.* match last occurence of 4 digits)-(.*)?$ album.php?artist=$1&album=$2&releaseyear=$3&extra=$4
is there way this?
i use rule:
rewriterule ^(.*)\/(.*)-(\d{4})(?:-(.*))?$ album.php?artist=$1&album=$2&releaseyear=$3&extra=$4
Comments
Post a Comment