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 badges3 Answers
Reset to default 1WAY #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
评论列表(0条)