I posted a question here which I got an answer for, but now I've identified an issue with the code.
Original Question:
RewriteRule ^([^-]+)-([^-]+)-(?!in)([^/]+)-([^-]{2})\.html$ /$1-$2-in-$3-$4.html [R=301,L]
RewriteRule ^([^-]+)-([^-]+)-(?!in)([^/]+)\.html$ /$1-$2-in-$3.html [R=301,L]
While the above fixed all the issues with the URLs, I noticed my normal URLs are having issues. Example, domain.com/careers-jobs-music-degree.html is turning into domain.com/careers-jobs-in-music-degree.html - the 'in' is being added to other URLs that don't have 'music-classes' in the URL. Is there any way to prevent this?
Thanks!