- David Burdon
- April 16, 2021
- 3 minutes
How to Implement a 301 Redirect
Implementing a 301 redirect or more precisely managing 301 redirects is increasingly an integral part of technical SEO. This is especially the case when websites expand or migrate from one owner, host, domain or code platform. Over time, websites, if not properly managed, tend to get ragged. Duplicate content, broken links and out of date site maps tend to be errors that show up in your Google Search Console Tools or Moz crawl diagnostics summary. Firstly a 301 redirect redirects a browser from an old to a new location. Secondly, and most importantly for SEO, a 301 redirect tells search engines that your web page has been permanently moved to another location or address. As a consequence, the search engines transfer the PageRank, or link juice, from the old location to the new.
Using a CMS for your Redirect
If you utilise a content management system or CMS, there are quite often tools inside that allow you to arrange redirects. Check in your CMS tools section first. If you use WordPress or similar platform you may find a plug-in that will do the redirect. If not, you will have to arrange the redirect yourself, usually via a .htaccess file. In my case, I was working on two separate redirects. One to send http://simplyclicks.com traffic to www.simplyclicks.com. The other to eliminate the index.html versions of my home page. There are good reasons for undertaking both redirects.
Redirecting http://yoursite.com to http://www.yoursite.com
There are two good reasons for implementing this redirect. Firstly, Google may treat the http:// only and the www versions of your site as two different sets of documents. Secondly here is a risk that you will build up two sets of inbound links. There are many ways of organising a redirect and the way selected depends on your operating system and server. In the most recent case, I was organising a redirect on an Apache server utilising Linux.
Redirecting www.yoursite.com/index.html to www.yoursite.com
My main reason for organising this redirect is a problem I have with web analytics. Quite often, web analytics will treat these two versions of the home page as two different pages. So you end up adding and diving all the time to get consolidated statistics for your home page. The second reason is more long term and affects link building. What happens, if people send links to a home page which is www.yoursite.com/index.html and you moved platforms? So that your home page became www.yoursite.com/index.php? Without a redirect, the old page would become a broken link, losing all its link juice or PageRank. This redirect also applies to a redirect of .php or similar. But not .asp as this would be covered by the Microsoft IIS and is not covered here.
The 301 Redirect Code
Below, I show the code used for organising both redirects in the same .htaccess file. The redirects must be in this order. The .htaccess file is uploaded to the root directly of your website that contains your home page.
########
RewriteEngine On
#
# redirect index.htm and index.html to / (do this before non-www to www)
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.html?\ HTTP/
RewriteRule ^(.*)index\.html?$ http://www.yoursite.com/$1 [R=301,L]
#
# redirect domain.com -> www.domain.com
#
RewriteCond %{HTTP_HOST} ^yoursite\.com$ [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]
########
If you use this code you will need to change the “yoursite.com” to your exact domain, e.g. simplyclicks.com in my case. This code works for me on Fasthosts.com, the largest UK hosting provider. You may need to make several tries and depending on your web host wait for the new .htaccess file to become activated.
Category:
Kent Household Income by Local Authority District
February 1, 2024
/
David Burdon
/
Analytics, PPC, Seo Optimization
/
Economic Development, Household Income, Kent Economy
The Kent Economy and Household Income Simply Clicks is based in Kent. We also have a number of clients based in Kent. Our economic knowledge and years of experience serving
Why A Kent Company Should Use A Kent PPC Agency
When it comes to managing a local PPC campaign, hiring a Kent PPC agency should be the preferred option for Kent-based companies. In this article, we discuss the advantages of
Why January is a Great Time for Starting an SEO Project
January 2, 2024
/
David Burdon
/
Analytics, Local SEO, Seo Optimization
/
Competition, January, Seasonality
Why January is a great time to implement an SEO project. Whether for local, national or International SEO.
The Decline of Keyword Density In SEO Importance
Exploring the Myth of Keyword Density Why Keyword Density Is Not Relevant For SEO In the ever-evolving realm of SEO, one term that has garnered both attention and confusion is
Use PPC to get your Kent business noticed nationally
We often work with clients that are based in Kent that have a good level of local business but also operate outside of the county. In this post we’ll talk
Marketing and the Kent Economy
An introduction to a series of posts on the Kent economy from the perspective of search marketing.
Automated PPC vs Manual Expertise
TLDR; We recently had the opportunity to run a PPC campaign against Google’s smart bidding. After 6 weeks, the results show why you should continue using a Digital Marketing agency,
Bounce Rate and How to Improve it
Bounce rate refers to website traffic that enters a site and leaves without carrying out any sort of action. A higher than average bounce rate indicates that there is an