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

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

How We Helped A Healthcare Company Reposition Their Brand

How We Helped A Healthcare Company Reposition Their Brand

After a car accident, the search for care starts within minutes, on a phone, before the shock wears off, and the patient commits to the first brand that reads as competent, calm, and ready to take the whole problem off their hands. In personal-injury healthcare, the brand that wins at first contact wins the rest:[...]
The B2B Lead Generation Funnel: From First Touch to Closed Deal

The B2B Lead Generation Funnel: From First Touch to Closed Deal

Most B2B marketing teams can generate leads. Fewer can predict them. The month a big trade show or a strong campaign lands, the pipeline looks healthy; through the quiet months that follow, sales starts asking where the opportunities went. The difference between a lucky pipeline and a predictable one is whether you treat lead generation[...]
Creating Better and Faster Landing Pages with AI

Creating Better and Faster Landing Pages with AI

Landing pages have always been one of the most important assets in a performance marketing program. They can support SEO campaigns, email campaigns, sales enablement, product launches, event promotion, and plenty of other initiatives. But for teams focused on paid media and lead generation, landing pages carry even more weight because they often determine whether[...]
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