Redirect to new domain that serves new and different content

What I want to do:

  1. Redirect old domain to new domain
  2. Redirect all urls of old domain to new domain's home page (Old and New site serves different contents)

What I've done:

  • 301 redirect old domain to new domain by using

RewriteRule ^(.*)$ http://example.com$1 [R=permanent,L]

  • changed site url and home address of the old domain to new domain

Problems:

  • It only redirects the home address (Old-Example.com) but not the content of the old website.

  • The 404 pages of old website are still reflecting old domain

Topic domain url-rewriting redirect Wordpress

Category Web


Welcome to SO. You're redirecting the users of old website to a new website which will not send the content to the new site. In order to do that what you can do is install a plugin, I usually recommend Updraft plugin to transfer the content of old site to the new site.

This is not only easy to use but also helps in transfering everything including media and database from the site a (old site) to the new site (site b).

Edit: Update your .htaccess to something like this:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^OLDDOMAIN\.com$ [NC]
RewriteRule ^(.*)$ http://NEWDOMAIN.com [R=301,L]

Hope this answers your question.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.