redirect - How to set 301 redirection after moving WordPress blog?

I have moved my wordpress blog to new domain.Old Address : domainnameblog |New Address : newdomainnamePlease pay atten

I have moved my wordpress blog to new domain.

Old Address : domainname/blog | New Address : newdomainname

Please pay attention about old address and new address.

Now I want to redirect all old pages to new blog ( should be 30 redirection).

I could not find way to do it properly because I moved my blog to new domain from old domain directory.

Thanks

I have moved my wordpress blog to new domain.

Old Address : domainname/blog | New Address : newdomainname

Please pay attention about old address and new address.

Now I want to redirect all old pages to new blog ( should be 30 redirection).

I could not find way to do it properly because I moved my blog to new domain from old domain directory.

Thanks

Share Improve this question asked Nov 25, 2014 at 5:59 Sasa1234Sasa1234 3621 gold badge6 silver badges17 bronze badges
Add a comment  | 

3 Answers 3

Reset to default 1

WAY #1 - cPanel

I assume your host is using cPanel managing your Server.

Browse domainname/cpanel, login their with cPanel credential:

Change the values according the following image:

Don't forget to check the "Wildcard Redirect" to redirect all the subfolder/subpages also (Thanks to @RobertHue). Add the redirection and you are done.

WAY #2 - .htaccess

Open up your .htaccess of domainname/blog/ in edit mode. Put the following code there (I made it using WebConfs Redirect Generator):

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://newdomainname/$1 [R=301,L]

Save it. And yala!

EDIT

That's well said by @RobertHue. I did not mention the subfolder or subpages redirection. So I edited my answer, changed the attached images and posted new code. Thanks a lot @RobertHue for pointing the important things.

Below query will help you to replace old pages to new domain :

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsiteurl', 'http://www.newsiteurl') WHERE option_name = 'home' OR option_name = 'siteurl';

Here is a simple redirect, where we are trying to send a user visiting an old post to a new post.

Redirect 301 /a-very-old-post/ /a-very-new-post/

You can add the code above preferably at the start of your .htaccess file.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745218100a4617118.html

相关推荐

  • redirect - How to set 301 redirection after moving WordPress blog?

    I have moved my wordpress blog to new domain.Old Address : domainnameblog |New Address : newdomainnamePlease pay atten

    3小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信