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
Related Posts:
- 301 Redirects for Changed Permalink Structure & Category Base
- How do I turn off 301 redirecting posts (not canonical)?
- Passing variables through permalink structure
- htaccess or redirect to cloak portion of a link?
- Redirect short-form URL to long-form URL (post_id to post_id + post_name)
- Auto 301 to full post permalink? (using /posts/%post_id%/%postname%)
- removed index.php now all pages 404
- Rewrite rule never matching
- Redirect old permalinks with Month and name to Post name on new site
- Rewrite-Rules not working on a vhost, everything goes to index.php
- Using WP rather than .htaccess to redirect pages/posts
- .htaccess – Redirect duplicated post ended in ‘-number/’ to the same url without the -number/
- WordPress redirection problem after moving to a new server?
- Why specific file directory fails to redirect but its parent folder succeeds?
- After moving from subdirectory to home, home page does not display
- Specific URL Rewriting with parameters in wordpress
- Problems redirecting to “pretty” permalinks (wordpress in Subdirectory)
- Permalinks: Page Not Found
- If I change permalink structures, can I use htaccess to permanantly redirect links?
- Redirect parent taxonomy to it’s child
- AWS WordPress Install – pages/posts 404 on restart until updating permalinks
- WordPress 404 in development area
- Need Help Correct Regular Expression Redirect Code
- Changing the post date without causing 404 error
- How do I add /blog/ as a prefix to permalink structure for posts, categories & tags?
- Page preview is shown, updating page gives 404 error
- Redirect Uploads Folder to Query Vars in WordPress
- Redirect a Blogger Page URL to wordpress
- Redirecting all posts after changing URL structure with htaccess
- Redirect all posts permalinks from “.html” to “/”
- WordPress 4.4 old permalink redirect
- Htaccess https 301 problem
- Accessing Subdirectories in WordPress Install
- How to use different domains for different blogs hosted in the same host in subdomains with .htaccess
- Resolve 404 on posts without category
- What causes /pages/ to appear in URI, and how to remove it?
- Some Pemalink problems, probably caused by wrong .htaccess configuration?
- Test site pages go to main site
- Comment author url link is wrong? How to change from authors/ to author/
- change WordPress permalinks and redirect new urls 301
- Custom permalink structure with %postname% in front of domain name
- Configuring Home Page Address
- permalink and add_rewrite_rule – error 404
- old permalinks not found
- corrupted URLs – can’t leave starting page
- remove SLASH on single_post but KEEP on categories and parent pages
- .htaccess to redirect to a wp page
- Extending page urls without getting a 404
- No Ones Been Able to Override my WordPress Rewrite Rule Issue!
- LetsEncrypt WordPress on the Raspberry Pi – Nice url’s give 404 with https, http works
- Can’t access WordPress site in subfolder possibly because of .htaccess redirect from root installation?
- When using number in url it is redircting to same page but when using character it redirects to 404
- Folder Name and Category Name WordPress
- WordPress permalink still not working (error or not understood?)
- Only homepage working correctly, 404 error on everything else
- Removed and Reinstalled WordPress, Redirect Broken now
- redirect old pages by .htaccess
- Why are all pages redirecting to homepage when using custom permalinks?
- .htaccess regex for redirect subdomain to root domain & redirect old permalinks
- 404 posts error after 301 redirection of changed category / tag base
- 301 Redirect posts to newly added categories
- Standard Htaccess directives disappear by themselves
- Changing permalinks gives me 404 errors on nginx
- Move WordPress to subdirectory, keep ALL URLs
- WordPress permalinks Yahoo hosting(no .htaccess allowed)
- Random Alphanumeric Key URLs
- Custom url for a single page
- Permalinks Structure and 404 Question
- RedirectMatch and Redirect interfering with each other
- I need a custom permalink for my website
- Clean install – Changing permalinks in twentyeleven give 404
- Permalinks not working
- add_rewrite_rule not working for me
- Using WP Rewrite, but just not “getting it”
- Rewrite CPT permalinks and include WPML language
- Need To Add Custom rewrite base url for individual user
- Custom permalink structure gives 404
- Post preview gives 404 when permalinks are purely date based
- Permalinks settings
- Permalink for specific page name
- Permalink for PDF of article
- Redirecting “wrong” but working links to their canonical URL in order to prevent search engine penalties (e.g. /123/ at the end of URLs)
- WordPress not generating .htaccess but tells me that (Permalink structure updated.)
- Getting an ID from a URL, why can WP do this itself, but none of of the functions provided get it right?
- Ignore postname in permalink
- Fix 404 error after changing permalink structure
- How can I set up a secondary permalink structure?
- how to set up wp in folder within static website?
- why wordpress keeps redirecting to old page after deleting it?
- Permalink structure /page/page/cpt-post gives 404 with pagination
- Rewrite posts url as they’re all children of a page
- htaccess and redirect to new url using regex
- Permalink Rewrite with Archive – Archive gets 404
- Why doesn’t WP update my .htaccess file?
- Pagination is not working, how to trace it properly?
- Problem when i configure permalink
- How to Redirect Url to homepage?
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- WordPress not remembering old slugs for pages
- make a new structure tag that does some processing