Skip to content
Home Blog Search Engine Optimization How to do 301 Redirects in .htaccess – Apache

How to do 301 Redirects in .htaccess – Apache

  • Search Engine Optimization
Blueprint Digital
Blueprint Digital

Insights from the Blueprint Digital team.

301 redirects are a search engine friendly way to redirect an old or un-used page to a new page, file or domain. 301’s are a vital part of search engine optimization because they allow you to pass page rank from an old page or domain without losing the page rank of the current url. This is very important when redirecting older pages or sites that have collected lots of “equity”.

Adding 301’s to .htaccess

There are many different ways of permanently redirecting urls to a new domain or page, but today I am going to show you how to do it through your .htaccess file.

I personally prefer using the .htaccess file for all of my redirects, as opposed to using a 3rd party WordPress plug in that may or may not go out of date or have issues down the road.

Step 1: Backup

Before making any changes in the .htaccess file make sure you download the original as a backup copy just in case anything goes wrong. The .htaccess file provides a vital role in how your website functions and one piece of wrong code could cause the site not to display properly.

Step 2: Writing the Redirect

Identify the old page that you want to redirect, then create or find the new domain, file or page that you want it redirected to. Once you have that the rest is fairly simple.

The first part is identifying the type of redirect you would like to perform. 301’s are a “permanent” redirect and pass page rank to the new url.

The next step is to type out the relative url of the old page. A relative URL is just the file path, without the domain name, ex. /file-name.html.

Next is to type the new site or page you will be redirecting to. This URL is an absolute URL, meaning it contains the domain name as well as the URL path.

Make sure there is one space between each segment.

Congratulations! You have just written your first 301 redirect!

Step 3: Adding a 301 redirect to the .htaccess file

This next step is very simple but can also be very delicate, depending on how large your .htaccess file is.

Below is the typical .htaccess file for a WordPress site. All you have to do is copy and paste the 301 redirect into the beginning of the file, save, upload back to the root and you’re done!

Be sure to test the redirect by trying to navigate to the old page, if it works you will be redirected to the new page!

I hope this has been an infomative and helpful walkthrough, if you think I missed something or would like more information, please send me an e-mail, info@eclipsewebmedia.com, or connect with me on Twitter or Google Plus.

Ready to Dominate Online and Grow Your Business?

Schedule time to connect with Blueprint about your online goals, or request a free review of marketing campaigns.

Related Posts

What Is Automated Lead Follow-Up and How Does It Work

What Is Automated Lead Follow-Up and How Does It Work

A new lead fills out a form, then waits. If the phone stays silent for a day, that lead has usually moved on to whoever answered first. Automated lead follow-up closes the gap. It is a marketing automation system that responds to every new inquiry within minutes, then continues the conversation through scheduled texts, emails,[...]
Free Advertising for Nonprofits Through Google Ad Grants

Free Advertising for Nonprofits Through Google Ad Grants

Advertising is usually the first line cut from a nonprofit budget, and the one that quietly costs the most to lose. Donors still search, scroll, and read, whether or not the cause has money to meet them there. Free advertising for nonprofits means promoting a cause without paying for placements, and it is how organizations[...]
Lead Scoring for B2B: How to Decide Which Leads Your Sales Team Chases

Lead Scoring for B2B: How to Decide Which Leads Your Sales Team Chases

Every marketing team has handed sales a list of leads that went nowhere. After a few of those lists, sales stops trusting them, works its own referrals instead, and the two teams settle into a standing argument about lead quality. Underneath the argument is a simpler problem: nobody has written down what a good lead[...]
Previous
Next

Partner with BLUEPRINT to reach your online goals, grow your business and reshape your story.

Get in touch with BLUEPRINT

Reach out to request a discovery call, a free campaign review, or for all other inquiries.

Subscribe to our newsletter