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

Digital Marketing for Orthopedic Surgeons

Digital Marketing for Orthopedic Surgeons

Orthopedic practices used to fill their schedules through physician referrals. Patients now find and choose their own surgeon online, often before a referral enters the picture. Someone with knee pain or a torn rotator cuff will research the problem and compare practices before calling any of them. Digital marketing for orthopedic surgeons reaches those patients[...]
How to Find AI Search Ranking Opportunities Your Competitors Are Winning (With Semrush)

How to Find AI Search Ranking Opportunities Your Competitors Are Winning (With Semrush)

If you’ve spent any time watching how people search over the past year, you’ve probably noticed a shift. More users are asking ChatGPT, Google’s AI Overviews, Perplexity, and other AI-powered search tools for recommendations instead of clicking through a page of blue links. While traditional SEO remains an important part of a digital marketing strategy,[...]
Personal Injury Marketing: A 2026 Playbook

Personal Injury Marketing: A 2026 Playbook

Injury care is one of the hardest categories in healthcare to market. Patients decide within days of getting hurt, and the keywords that reach them are among the most expensive in search. A practice can rank at the top of Google and still lose the patient to a competitor who answered the phone first. Personal[...]
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