The following rule keeps all of the old permalinks on a migrated publication site happy:
RedirectMatch Permanent /(.*)/(.*)/(.*)\.php$ http://somedomain.net/$1/$2/$3
Works perfectly for the public site, but unfortunately it breaks some plugins. I want to modify it to not take effect if the URL starts with /wp-admin. I’ve tried variants like these:
but every attempt breaks the rule on the public site. Can anyone suggest a way to have an optional block at the start of the URL so that it won’t affect the rest of the rule, and that will also not kick in when /wp-admin URLs are requested?
Failing that, a workable solution with Rewrite instead of RedirectMatch?
- The topic ‘Writing a regex that excludes wp-admin’ is closed to new replies.