Do you should create a 301 redirect in your WordPress web site? You’ve come to the appropriate place! We’ll present you tips on how to arrange 301 redirects utilizing three strategies. Have you learnt if you should use a redirect or whether or not a 301 redirect is true? No worries, we’ll clarify that, too.
Redirects in a nutshell
The identify ‘redirect’ says all of it: It sends guests touring from a particular web page to an alternate one as a substitute. Or, if there’s no different, an HTTP header (just like redirects) could make that clear to customers and engines like google. It’s like registering a change of deal with once you transfer home. What if an previous pal visits your previous dwelling to go to you? A redirect is sort of a entrance door be aware telling your guests the place you reside now. Any time you modify a URL or delete a web page, you need to take into consideration redirects.
Totally different redirects serve totally different functions. Since this submit is all about 301 redirects, let’s have a look at some conditions the place you may want to make use of one.
When must you use a 301 redirect?
A 301 redirect needs to be used when:
- You’ve completely deleted a web page in your web site, however you will have one other related web page you need to ship customers to as a substitute
- You’ve modified the URL of a web page that was already printed
- You’re transferring your web site to a brand new area
- You’re altering your URL construction, e.g. altering from HTTP to HTTPS, or eradicating ‘www’ from the beginning of your URL
These are among the extra frequent causes for utilizing a 301 redirect, however different conditions require redirecting, too. And in addition to that, there are different redirects and HTTP headers you need to use in different conditions. For example, when you completely delete a web page and there’s no appropriate alternative or substitute you may ship customers to, then a 410 redirect is what you should use. We now have one other submit the place you may learn extra about which redirects to make use of by which conditions.
Possibility 1: Create a 301 redirect on the server
To arrange a 301 redirect utilizing .htaccess
for the given instance URLs, you should add a particular line to your web site’s .htaccess
file, which is situated within the root listing of your WordPress set up. Right here’s how you are able to do it:
- Entry your server. Entry your web site’s information utilizing an FTP shopper or your internet host’s file supervisor. You can even entry and edit your .htaccess file from contained in the Yoast search engine optimisation instruments part.
- Find the .htaccess file: The
.htaccess
file is normally within the root listing of your WordPress set up. - Edit the .htaccess file: Open the
.htaccess
file with a textual content editor. - Add the redirect rule: Insert the next line on the finish of the file to create the redirect. This rule signifies that requests to
/page-1
needs to be completely redirected to/page-2
.
Redirect 301 /page-1 /page-2
- Save adjustments: In the event you use an FTP shopper, save your adjustments to the .htaccess file and add them again to your server.
Utilizing this rule, any request to https://instance.com/page-1
will probably be completely redirected to https://instance.com/page-2
. The 301
standing code signifies to engines like google and browsers that the redirect is everlasting. Word that this method assumes the URLs observe the format /page-1
and /page-2
with out extra subdirectories. You possibly can regulate the trail in case your URLs are totally different.
These configurations can turn out to be unmaintainable over time, particularly when you’re an avid blogger attempting to enhance your posts’ search engine optimisation. It’s essential to additionally log in to your server over FTP, edit the information, and re-upload them everytime you add a brand new redirect. That’s why, typically talking, this technique will not be thought of the way in which to go.
Possibility 2: Create a 301 redirect with Cloudflare
Most of us already use Cloudflare in a single kind or one other, so you realize that it presents a big selection of instruments to assist our web sites carry out. For example, it comes with a Guidelines function the place you may set varied choices associated to your web site cache. You can even discover varied redirect choices right here; this can enable you to information up redirects for every thing from HTTP to HTTPS to single redirects for particular person pages.
It’s straightforward to arrange redirects by Cloudflare. Right here’s how that works:
- Log into your Cloudflare account: Go to the Cloudflare dashboard and choose your account and area. Then, choose Guidelines and Overview.
- Create a redirect rule: Choose Create rule after which select Redirect Rule. Within the Rule identify subject, you may identify it one thing like
Redirect Web page 1 to Web page 2
. - Outline the matching standards: Set a wildcard sample and set the Request URL to
https://instance.com/page-1
. This implies any visitors toinstance.com/page-1
will probably be matched for redirection - Set the redirect parameters:
- Goal URL: Enter
https://instance.com/page-2
because the redirect vacation spot. - Standing code: Choose
301
to point a everlasting redirect. - Protect question string: Resolve primarily based in your choice; allow this feature if the unique URL’s question string needs to be retained. Whenever you select to protect the question string in a redirect, you retain any extra parameters which may be included within the unique URL when redirecting to the brand new URL. Preserving the question string is commonly helpful for monitoring functions, like retaining analytics or promoting parameters, making certain that helpful knowledge isn’t misplaced throughout redirection.
- Goal URL: Enter
- Deploy the rule:
Click on Deploy to avoid wasting and activate the redirect.
Now, at any time when somebody visits https://instance.com/page-1
, they are going to be redirected to https://instance.com/page-2
with a 301 standing code, indicating a everlasting transfer.
You possibly can effectively handle visitors with out touching your server configuration by organising redirects through Cloudflare. It supplies flexibility for utilizing easy patterns or extra advanced URL constructions.

Possibility 3: Create a 301 redirect the straightforward means with Yoast search engine optimisation
Our Yoast search engine optimisation Premium plugin presents you a serving to hand in relation to creating these redirects. Our built-in redirect supervisor assists you everytime you change the URL of a submit, web page, or any taxonomies that will lead to a potential 404 when you don’t correctly redirect guests. As well as, we additionally give you an interface to edit or take away these redirects at a later cut-off date. The plugin additionally tells you once you’re about to create a redirect that can lead to a redirect loop. This looping is one thing you need to keep away from in any respect prices.
Right here’s how one can arrange a 301 redirect utilizing Yoast search engine optimisation Premium in WordPress:
- Entry the Yoast search engine optimisation settings: Log into your WordPress admin space and navigate to the Yoast search engine optimisation part.
- Open the Redirect Supervisor: Go to the Redirects function in Yoast search engine optimisation Premium.
- Add a brand new redirect: Comply with the steps beneath to create a brand new rule.
- Within the Outdated URL subject, enter
/page-1
because the supply path. - Within the New URL subject, enter the vacation spot
/page-2
as the entire new URL. - Select a 301 (Moved Completely) from the listing of redirect sorts.
- Within the Outdated URL subject, enter
- Save the Redirect: Click on Add redirect, and Yoast search engine optimisation will deal with the redirection.
Yoast search engine optimisation Premium additionally presents an choice to robotically redirect deleted content material. Whenever you delete a web page or submit, Yoast search engine optimisation prompts you to arrange a redirect to keep away from damaged hyperlinks. This ensures guests and engines like google received’t encounter 404 errors and are easily directed to a related web page.
These options are a part of Yoast search engine optimisation Premium, designed to make managing redirects easy with out manually altering code or server settings. They preserve your web site user-friendly and assist keep search engine optimisation efficiency by stopping lifeless hyperlinks.

Conclusion
Understanding tips on how to arrange 301 redirects is crucial for sustaining your web site’s integrity and consumer expertise. Whether or not you select Cloudflare, Yoast search engine optimisation Premium, or the .htaccess technique, every method presents a easy resolution to information guests to the appropriate place, stopping 404 errors and retaining your search engine optimisation rankings intact. Easily transitioning visitors from previous hyperlinks to new ones enhances usability and search visibility. Select the most effective technique that fits your wants and retains your web site operating easily.
Learn extra: How you can correctly delete pages out of your web site »
Do you should create a 301 redirect in your WordPress web site? You’ve come to the appropriate place! We’ll present you tips on how to arrange 301 redirects utilizing three strategies. Have you learnt if you should use a redirect or whether or not a 301 redirect is true? No worries, we’ll clarify that, too.
Redirects in a nutshell
The identify ‘redirect’ says all of it: It sends guests touring from a particular web page to an alternate one as a substitute. Or, if there’s no different, an HTTP header (just like redirects) could make that clear to customers and engines like google. It’s like registering a change of deal with once you transfer home. What if an previous pal visits your previous dwelling to go to you? A redirect is sort of a entrance door be aware telling your guests the place you reside now. Any time you modify a URL or delete a web page, you need to take into consideration redirects.
Totally different redirects serve totally different functions. Since this submit is all about 301 redirects, let’s have a look at some conditions the place you may want to make use of one.
When must you use a 301 redirect?
A 301 redirect needs to be used when:
- You’ve completely deleted a web page in your web site, however you will have one other related web page you need to ship customers to as a substitute
- You’ve modified the URL of a web page that was already printed
- You’re transferring your web site to a brand new area
- You’re altering your URL construction, e.g. altering from HTTP to HTTPS, or eradicating ‘www’ from the beginning of your URL
These are among the extra frequent causes for utilizing a 301 redirect, however different conditions require redirecting, too. And in addition to that, there are different redirects and HTTP headers you need to use in different conditions. For example, when you completely delete a web page and there’s no appropriate alternative or substitute you may ship customers to, then a 410 redirect is what you should use. We now have one other submit the place you may learn extra about which redirects to make use of by which conditions.
Possibility 1: Create a 301 redirect on the server
To arrange a 301 redirect utilizing .htaccess
for the given instance URLs, you should add a particular line to your web site’s .htaccess
file, which is situated within the root listing of your WordPress set up. Right here’s how you are able to do it:
- Entry your server. Entry your web site’s information utilizing an FTP shopper or your internet host’s file supervisor. You can even entry and edit your .htaccess file from contained in the Yoast search engine optimisation instruments part.
- Find the .htaccess file: The
.htaccess
file is normally within the root listing of your WordPress set up. - Edit the .htaccess file: Open the
.htaccess
file with a textual content editor. - Add the redirect rule: Insert the next line on the finish of the file to create the redirect. This rule signifies that requests to
/page-1
needs to be completely redirected to/page-2
.
Redirect 301 /page-1 /page-2
- Save adjustments: In the event you use an FTP shopper, save your adjustments to the .htaccess file and add them again to your server.
Utilizing this rule, any request to https://instance.com/page-1
will probably be completely redirected to https://instance.com/page-2
. The 301
standing code signifies to engines like google and browsers that the redirect is everlasting. Word that this method assumes the URLs observe the format /page-1
and /page-2
with out extra subdirectories. You possibly can regulate the trail in case your URLs are totally different.
These configurations can turn out to be unmaintainable over time, particularly when you’re an avid blogger attempting to enhance your posts’ search engine optimisation. It’s essential to additionally log in to your server over FTP, edit the information, and re-upload them everytime you add a brand new redirect. That’s why, typically talking, this technique will not be thought of the way in which to go.
Possibility 2: Create a 301 redirect with Cloudflare
Most of us already use Cloudflare in a single kind or one other, so you realize that it presents a big selection of instruments to assist our web sites carry out. For example, it comes with a Guidelines function the place you may set varied choices associated to your web site cache. You can even discover varied redirect choices right here; this can enable you to information up redirects for every thing from HTTP to HTTPS to single redirects for particular person pages.
It’s straightforward to arrange redirects by Cloudflare. Right here’s how that works:
- Log into your Cloudflare account: Go to the Cloudflare dashboard and choose your account and area. Then, choose Guidelines and Overview.
- Create a redirect rule: Choose Create rule after which select Redirect Rule. Within the Rule identify subject, you may identify it one thing like
Redirect Web page 1 to Web page 2
. - Outline the matching standards: Set a wildcard sample and set the Request URL to
https://instance.com/page-1
. This implies any visitors toinstance.com/page-1
will probably be matched for redirection - Set the redirect parameters:
- Goal URL: Enter
https://instance.com/page-2
because the redirect vacation spot. - Standing code: Choose
301
to point a everlasting redirect. - Protect question string: Resolve primarily based in your choice; allow this feature if the unique URL’s question string needs to be retained. Whenever you select to protect the question string in a redirect, you retain any extra parameters which may be included within the unique URL when redirecting to the brand new URL. Preserving the question string is commonly helpful for monitoring functions, like retaining analytics or promoting parameters, making certain that helpful knowledge isn’t misplaced throughout redirection.
- Goal URL: Enter
- Deploy the rule:
Click on Deploy to avoid wasting and activate the redirect.
Now, at any time when somebody visits https://instance.com/page-1
, they are going to be redirected to https://instance.com/page-2
with a 301 standing code, indicating a everlasting transfer.
You possibly can effectively handle visitors with out touching your server configuration by organising redirects through Cloudflare. It supplies flexibility for utilizing easy patterns or extra advanced URL constructions.

Possibility 3: Create a 301 redirect the straightforward means with Yoast search engine optimisation
Our Yoast search engine optimisation Premium plugin presents you a serving to hand in relation to creating these redirects. Our built-in redirect supervisor assists you everytime you change the URL of a submit, web page, or any taxonomies that will lead to a potential 404 when you don’t correctly redirect guests. As well as, we additionally give you an interface to edit or take away these redirects at a later cut-off date. The plugin additionally tells you once you’re about to create a redirect that can lead to a redirect loop. This looping is one thing you need to keep away from in any respect prices.
Right here’s how one can arrange a 301 redirect utilizing Yoast search engine optimisation Premium in WordPress:
- Entry the Yoast search engine optimisation settings: Log into your WordPress admin space and navigate to the Yoast search engine optimisation part.
- Open the Redirect Supervisor: Go to the Redirects function in Yoast search engine optimisation Premium.
- Add a brand new redirect: Comply with the steps beneath to create a brand new rule.
- Within the Outdated URL subject, enter
/page-1
because the supply path. - Within the New URL subject, enter the vacation spot
/page-2
as the entire new URL. - Select a 301 (Moved Completely) from the listing of redirect sorts.
- Within the Outdated URL subject, enter
- Save the Redirect: Click on Add redirect, and Yoast search engine optimisation will deal with the redirection.
Yoast search engine optimisation Premium additionally presents an choice to robotically redirect deleted content material. Whenever you delete a web page or submit, Yoast search engine optimisation prompts you to arrange a redirect to keep away from damaged hyperlinks. This ensures guests and engines like google received’t encounter 404 errors and are easily directed to a related web page.
These options are a part of Yoast search engine optimisation Premium, designed to make managing redirects easy with out manually altering code or server settings. They preserve your web site user-friendly and assist keep search engine optimisation efficiency by stopping lifeless hyperlinks.

Conclusion
Understanding tips on how to arrange 301 redirects is crucial for sustaining your web site’s integrity and consumer expertise. Whether or not you select Cloudflare, Yoast search engine optimisation Premium, or the .htaccess technique, every method presents a easy resolution to information guests to the appropriate place, stopping 404 errors and retaining your search engine optimisation rankings intact. Easily transitioning visitors from previous hyperlinks to new ones enhances usability and search visibility. Select the most effective technique that fits your wants and retains your web site operating easily.
Learn extra: How you can correctly delete pages out of your web site »