The easiest way is to use search and replace for wordpress databases
Then you should do a 301 redirect the old domain to the new domain to keep visitors and indexed in Google.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^old-domain\.com [NC]
RewriteRule (.*) http://new-domain.com/$1 [R=301,L]
I hope I’ve helped you with my answer.
Related Posts:
- How do you create a “virtual” page in WordPress
- Multiple endpoints to same page
- How to make a category page the blog home page?
- How to prevent redirection to max 2147483647 for larger values of the page query variable?
- Preserving $_GET parameter while using custom Rewrite Rule
- Handle category name URL rewrite before different post type slugs
- Taxonomy rewrite question
- Rewrite rules in .htaccess get overwritten?
- Getting add_rewrite_rule and add_rewrite_tag to work
- Why did installing wordpress in url root jack up underlying WP sites?
- How do I create a dynamic page?
- Dynamic URL, not a physical page within the database
- Passing & Reading URL Parameters with URL re-writing
- Prevent WordPress from automatically correcting URLs
- add_rewrite_rule and pagination issue
- Display content according to current URL
- Nginx rewrite rule conflict with WordPress permalinks rule
- External/non-WP rewrite rule without QSA
- How to do Basic URL Rewrite Without Redirecting
- URL Rewrite doesn’t work for nested pages
- Using custom mod_rewrite without breaking wordpress permalinks
- WordPress Redirects When a Query String Contains a Number
- How does WordPress determine if a paged query var is too high?
- How to remove parent section from attachment URL?
- How to redirect http://mydomain/blog/blahblah/ to http://mydomain/blahblah/ in wordpress htaccess?
- Append a query string to the end of every URL
- Url Rewriting a dynamic wordpress page
- Login page is redirecting to homepage
- subdirectory install breaking existing links
- Auto generate rewrite rules for multiple taxonomies
- Right url for custom post type
- Preserve old website URL structure after migrating to WordPress
- How to redirect specific URL to Subdomain
- Rewriting “pretty” blog category URL with htaccess / add_rewrite_rule() causes 404 page
- Custom rewrite causes 404 on pagination
- Redirecting /px/?q=x to /px/x/
- Multiple query vars sorting combination and url rewrite
- URL redirect on updating the post date
- WP Rewrite issue
- WordPress keeps writing rewrite rules to .htaccess
- Is it possible to match site root with a WP rewrite rule? [closed]
- How to rewrite AJAX call URL to admin-ajax.php to match REST style URLs
- Add parameter to URL
- Changing URL scheme, mod_rewrite not helping
- WordPress rewrite rule not working
- Rewrite vs Redirect from ?p={ID}
- Is WordPress API visible from PHP file called in htaccess
- Requested URL changes when using custom rewrite rule
- Insert post ID into the end of a slug preceeded by a dash
- Make Author Archive Page URL be a Subdirectory of a Custom Post Type URL
- Redirect old query string urls to new SEO urls
- Flushing rewrite rules
- Bilingual WP site: How to achieve different URL sturcture rule based on its language?
- Using a Rewrite URL in a Plugin to Load a New Page in the Template
- How can I create custom URL routes?
- Create custom url which executes code (not render render a WordPress entity)?
- Rewrite author URL to example.com/u/{user_id}/{username}/
- Overwrite WordPress’s URL rewrite not working
- 404 redirect based on url
- How to change the displayed URL?
- Get logged in username in wordpress url
- How to show one page with two different templates
- URL problem: www.sitename.com/blog and www.sitename.com/learn using same WP installation
- WordPress 3.1.2 Network Enabled non-www to www
- Add NUMBER in WordPress URL
- add_rewrite_rule() issue with parent/child/child page
- Point 404 pages to homepage
- Rewrite only if no other matching page is found
- How to customize the Lost Password URL?
- Custom author url and page for another role
- Rewrite query var on postname
- URL rewrite problem in WordPress plugin
- Usw add_rewrite_rule to display frontpage on specific page
- “SAVE PERMALINKS” does more than FLUSH_REWRITE_RULES?
- Rewriting URL with child pages
- Rewrite URL to get rid of wp-content etc and change URL
- Rewrite URL for attachments
- How to add gallery slug to attachment url?
- URL Rewriting Per User
- How to Rewrite the URL
- Pagination appearing twice in URL after rewrite
- URL rewrite before template_redirect called
- Rewrite rules goes away
- Redirect if string found in URL
- Custom mod rewrite function not responding
- Rewrite custom taxonomy URL
- Simple URL rewriting gone wrong
- How to turn off searching from URL and go straight to 404 page
- Rewrite URL based on form input
- Getting URL Variables with a Rewritten Page (Login Page)
- What is the proper way to use add_rewrite_rule to remove the (question mark)?
- Custom Rewrite Problem
- WordPress post-type create url rewriting
- help with rewrite_tag and rewrite_rule for custom page GET variables [duplicate]
- Replacing broken urls (dreamweaver) to new ones in wordpress
- How to redirect a virtual page (e.g. /blog) to the home page?
- Wrong rewrite rules
- How to make custom WordPress page deliver search results
- URI rewriting: handling one page
- Problems Implementing Non-WordPress Rewrite Rules