Custom Permalink

The custom rule you are trying doesn’t meet the criteria. Here’s a nifty online .htaccess tester tool to see to check rewrite logic.

Use the follow RewriteRule instead:

RewriteCond %{QUERY_STRING} (^|&)name=(.*)
RewriteRule ^(.*)$ /profile/%2/? [R=301,L]

Be sure to replace ^example\.com$ on the first line with your actual domain.

You can also embed it in the <IfModule mod_rewrite.c> tag that was created by WordPress, which should look like the following as the end result:

# 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]
# BEGIN Custom Rules
RewriteCond %{QUERY_STRING} (^|&)name=(.*)
RewriteRule ^(.*)$ /profile/%2/? [R=301,L]
</IfModule>
# END Custom Rules
# END WordPress