I need help creating redirects for migrated sites and can use RegEx. This is the first link If you just need the last part 'will know that the event will always be in front of the URL) Then the following two will work. It matches all of the one, but there is a slash between the slash and the end of the string. There is a replacement version that changes everything up to the last slash. /cms/events/view/13-03-20/some-post_title.aspx and it is after
/ event / some-post_title . Anyone know about RegEx patterns that can do this?
var newurl = '/ event /' url.match (/ [^ / /] * $ /);
var newurl = url.replace (/ (/ | ^) ([^ /] * /) * /, '/ Event /');
No comments:
Post a Comment