How to Setup 301 Redirect in WordPress Without Plugin
301 Redirect is a way to redirect the traffic from one site to another permanently. Also, it passes the search engine ranking to redirected site. Besides, I found there are many of people who are looking for 301 redirects and How to Setup 301 Redirect in WordPress Without Plugin. However, I also wrote an article on 301 redirects earlier.
If you haven’t read it yet then you can check the link given below:
Apart from this, I got many queries from my visitors asking me about How to Setup 301 Redirect in WordPress Without Plugin.
Besides, I recently got a comment from my visitor asked me “How to Setup 301 Redirect in WordPress Without Plugin”. So, I thought instead of telling individually, why not to write an article on it. Also, it will helpful for others who are looking for the same thing. This is reason today I write this article and I will explain How to Setup 301 Redirect in WordPress Without Plugin.
How to Setup 301 Redirect in WordPress Without Plugin
If you have some extra WordPress site or blogs which are unusable then your backlink will get wasted. But if you redirect your site to another site without losing SEO and traffic, then your backlinks will not get wasted.
However, There are a lot of techniques of Redirections such as 301 Redirect and 302 Redirect.
- 301 Redirect: It is permanent redirect which from one URL address to other.
- 302 Redirect: It is temporary redirect which also direct visitors from one URL to another but for a temporary basis. It usually used when a site goes under some maintenance for some time.
We will discuss how we can set up both the redirections on WordPress site or blog.
-
How to Setup 301 Redirect in WordPress Without Plugin
It is very easy to How to Setup 301 Redirect in WordPress Without Plugin. You just need to follow the steps given below:
- Firstly, Login to your WordPress site which you want to redirect to another website. Let’s take an example, you have website abc.com which I want to redirect to my WordPress blog SeoRamanArora. So, I will open WordPress Dashboard of abc.com.
- Now, Go to Appearance >> Editor >> Header.php
- Here add the code in the header.php file where the head tag is started <head>. Such as I have done for abc.com
Paste the Code written at below.
<?php
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: https://www.seoramanarora.com/”);
?>
In Location, you have to write the URL address of your site where you want to redirect your site traffic and backlinks.
In this way, you can Setup 301 Redirect in WordPress Without Plugin. This will permanently redirect your site to another site without losing SEO.
-
302 For temporary WordPress Blog/ Site Redirection
Now discuss how to redirect your WordPress blog to another blog for some time or temporary. Go to your WordPress Website
Follow the steps given below:
- Firstly, Go to your WordPress Website which you want to redirect to another website.
- Now Go to Appearance >> Editor >> Header.php
- Here add the code in the header.php file at the same place which I have told you above in 301 redirect.
Paste the Code written at below.
<?php
header(“HTTP/1.1 302 Moved Temporary “);
header(“Location: https://www.seoramanarora.com/”);
?>
As I told you above, location will display where you want to redirect your WordPress site.
That’s all. I have told you how you can move your WordPress blog/site from one to another both permanently or temporary.
Do you know you can also redirect your WordPress posts from one URL to other?
Yes guys, now you can also redirect traffic and backlinks of one WordPress post to another without any plugin. Assume, your post contains too many broken links, then you will more likely to lose your visitor soon. In that case, you can temporarily redirect your WordPress post to another post. Meanwhile, you can find & fix broken links of your post. After fixing the dead links, you can again redirect to your post to previous one.
Check Out:
Let’s discuss how to redirect one post to another post in WordPress.
-
How to Setup 302 Redirect for WordPress Posts
Follow the steps given below:
- Login to your WordPress Dashboard.
- Next, Go to Posts >> All Posts
- Now Open the post, which you want to Redirect. For Example, I will open the First Article How to Create Google Search Network Ads Campaign in AdWords and I want to do some changes on it. So, I want to redirect their traffic to other article.
- Click on the text mode in the Text Editor. Find related article article and copy their link. Paste it in Location to redirect the traffic to other post.
- Next, paste the script given below at the top of the text editor.
<script>
window.location=”https://www.seoramanarora.com/ad-campaign-in-google-adwords/“;
</script>
In the Location: Enter URL address of the WordPress post where you want to redirect your post.
As I told you above, This is a temporarily WordPress post redirection, use you can remove this after the changes.
Besides this, you can also permanently redirect a WordPress post or article to other. Let’s discuss how you can do it.
-
How to Setup 301 Redirect for WordPress Posts without Plugin
Ther are few steps which you have to follow:
- Login to your cPanel.
- Find the .htaccess file in the root directory of your site.
- Select the file and click on edit to open the file. Now paste the following code in the file:
RewriteEngine On
Redirect 301 old-post-url new-post-url
That’s all. Now I have told you everything about How to Setup 301 Redirect in WordPress Without Plugin. So, go ahead and try these on your WordPress site. Above all, I will suggest to backup your file before you do some changes on it.
Related Articles:
- How to Move a Blog from Medium to WordPress
- Beginner’s Guide – How to Move Blog from Blogger to WordPress
- How to Move Your Blog from Tumblr to WordPress For Beginners
Final Words
I tried my best to deliver the information through this article. Also, I hope you find this article “How to Setup 301 Redirect in WordPress Without Plugin” helpful. Besides, If you like this article, don’t forget to share this post on social media. Moreover, you can Keep in touch with me on Facebook, twitter,LinkedIn
Raza
Posted at 01:29h, 02 JanuaryGood !