301 Redirect & HTACCESS file explained

301 Redirect & HTACCESS file

The foundation of your site is critical to successful search rankings.  As I cover a lot on this site there are a number of technical tweaks that should be made many of these are found in the .HTACCESS file.

What is HTACCESS?

I am often asked to explain the HTACCESS File.  In short it is a file on your server you can configure to manage redirects (and how page paths are handled).

More accurately, Apache describes it as:

.htaccess files (or “distributed configuration files”) provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.

If you are not technically savvy this may be a task you should consider hiring a web consultant to help you with.

View Slidedeck

Some vocabulary to know when dealing with this subject is:

File Transfer Protocol (FTP):  You will need to use an FTP program (Such as FileZilla) to access your web server.

Uniform Resource Locator (URL): This is just a long name for your page path (e.g. /mypage.html) (*For geeks out there more, I know it is technically a URI but I am trying to simplify this with more common terms)

404: This is the server response code for “Not Found”

301: This is the server response code for “Permanent Redirect”

Other Types of Redirects: There are other ways to redirect pages using Javascript, ASP, PHP, etc. THESE ARE NOT RECOMMENDED! They feel spammy to the search engines. Use 301 Redirects in your HTACCESS file (If on Apache).

Why Redirecting Pages?

There are a number of reasons why you would need to implement a 301 redirect.

Fixing Broken Links on Website

/old-page.html /new-page/ 404 Error

Add to your .htaccess file:

Redirecting to WWW

Redirecting to or from http://WWW.

Add to your .htaccess file:

Redirecting to new domain

http://olddomain.com to  http://newdomain.com

Add to your .htaccess file:

WordPress Rewrites

index.php?id=2 /my-path/

Add to your .htaccess file:

 

Editing your HTACCESS file

Prerequisite: File Transfer Protocol (FTP) Learn how to use FTP before expecting to edit your HTACCESS file.

Find or Create the File You will want to edit it with a plain text editor (notepad or similar, I like “Sublime Text” editor). If the file is not there you can create one. Just name it: “.htaccess”

WordPress “Redirection” Plugin If you are using WordPress you can use a plugin to manage your redirects. This is not as powerful but is easier to use. https://wordpress.org/plugins/redirection/

Website Redesign Cleanup

  1. Finding Missing Pages In Google just type site:yourdomain.com  to return a list of pages in your website that Google has in their index.
  2. Add 301 Redirects Redirect old page to new page:
  3. For obsolete pages just redirect to homepage:
    301 Redirect /obsolete-page/ /

Also learn about: Google Webmaster Tools Learn about Google (and Bing’s) Webmaster Tools to optimize your site.