I am in the middle of changing our site URL structure from this site.com/?team=john-doe to site.com/attorney/john-doe. I have the typical WordPress Htaccess rewrite rules in the htaccess file but what I'm having trouble is we have multiple attorneys that have the ?team=followed by the name. I am trying to do one rule to redirect all with the name being a variable - if that makes sense.
site.com/?team=jane-doe
site.com/?team=nic-cage
Below I commented out a method but when I tried it I got 500 Internal Server error:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#RewriteCond %{REQUEST_URI} ^/$
#RewriteCond %{QUERY_STRING} ^?team=([x]*)$
#RewriteRule ^(.*) site.com/attorneys/$1 [R=302,L]
</IfModule>
# END WordPress
I also applied this regex:
RedirectMatch 301 ^/?team=(.*)$ site.com/attorneys/$1
Regex is pretty confusing, sorry if I'm not making any sense. I can try and clarify if needed.