Reputation: 1344
Two questions only:
I have a website including a section of Blog in wordpress. Now requirements are changed and my client wants me to make a blog section on a different domain. He wants the website and the blog on different domains. Yesterday I setup the blog on a different server but the problem is when I click on any post it takes to me to the post on the old domain. Any idea how can I fix that issue?
Also we have sent out so many newsletters to our customers in which we have posted URLs of the old domain. Is it possible to redirect them to the post on the new domain and what is the process?
I really appreciate if you give me articles or tutorial links that can help me in this as I am not a PHP guy.
Upvotes: 0
Views: 215
Reputation: 1716
That's an interesting stuff, so here's how you should proceed -
Solution to your first question is to replace the old domain with new one in the MySQL dump file. Before you proceed, please take the backup of your database, just in case you mess around. But this solution works the best, since I transfer client's websites from my Devserver to the live servers ever now & then. Follow these steps -
Solution to your Second Question is to setup .htaccess redirect. I am sure you are using apache server, cause everyone does that :) , it's pretty easy to setup .htaccess redirect using which you can redirect all the visitors visiting old website to the new website URL. I used the following code on my blog few years back, and have a blogpost on how to setup apache redirect to new domain, just in case you want to know more about it.
RewriteCond %{HTTP_HOST} ^.*old_domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.new_domain.com/$1 [R=301,L]
Do let me know if something is unclear, I will try to clarify it.
Cheers,
Sachin Khosla
Upvotes: 1