We have a new website, build in WordPress. It will be replacing the old website, which was build on a custom CMS.
The old site is using this structure > domain.nl/content/page-title for most of the content pages. On the new site we will be using domain.nl/page-title.
We also combined a couple of very short content pages into 1. e.g. domain.nl/pageaboutsubject1 and domain.nl/pageaboutsubject2 are now on domain.nl/pageboutboth
The issue with the folder I can resolve by using:
RewriteRule ^content/(.*)$ /$1 [R=301,L]
RewriteRule ^content/subject1 /subjectboth [R=301]
RewriteRule ^/subject1 /subjectboth [R=301]
Problem seems to be in your reegx for matching 2nd rule.
This should work for you:
RewriteEngine on # match /subject1 or /subject2 and redirect them to /subjectboth RewriteRule (^|/)(subject1|subject2) /subjectboth [R=301,L,NC,NE] # otherwise remove /content/ from start of URLs RewriteRule ^content/(.*)$ /$1 [R=301,L,NC,NE]