301 vs 302 Redirect

301 vs 302 redirect
If you want to redesign your static website and convert it to a content management system (CMS) you’ll have trouble maintaining the same URL structure.

For instance your static page may look something like http://www.domain.com/oldpage.html and your CMS page looks like http://www.domain.com/newpage.

If the URL structures don’t match you may lose all your current search engine rankings for that page unless you redirect it correctly.

What is a 301 redirect?

This is when you want to redirect an old page or website permanently to a the new page or new website. It permanently transfers the page rank and search engine rankings to the new location. In most cases a permanent 301 redirect should be used.

What is a 302 redirect?

This is often called a temporary redirect. It informs the search engines to read and use the content on the new page or site, but to keep checking the original URL first as it will ultimately be reestablished.

Common uses for a 301 redirect

1. Redirect deleted pages

Perhaps you wish to remove a web page because the content is no longer relevant but don’t want to lose your current search engine rankings. Even after you remove the page it will remain in Google’s cache. In this case use a 301 redirect to direct visitors to the new page then delete the old page. Visitors who type the old URL in their browser will get redirected to the URL of the new page.

2. Redirect old domain to new domain

Keep your old domain if it’s at all possible because search engines give credit to domains that have been registered for many years. New domains are often used by spammers so it takes time for them to obtain good rankings. If you absolutely must use a new domain then use a 301 redirect. This will transfer the content and rankings to the new domain.

3. Redirect non.www pages to www. pages

If you can type http://domain.com or domain.com for your home page this means Google sees two different pages and will split the rankings between them. To prevent this from happening you need to use a 301 redirect to redirect all non.www pages redirect to www. pages. After you’ve implemented the 301 redirect check that all non.www pages are redirected to the same URL…http://www.domain.com/

4. Duplicate web pages

Website designers often make the mistake of creating duplicate pages while building a website. For instance when they create the navigation structure they use index.html for all pages outside the home page instead of http://www.domain.com/. This means Google will display both http://www.domain.com/ and http://www.domain.com/index.html for the home page and also split the rankings.

To correct this first make sure all links in the navigation bar that point to the home page go to http://www.domain.com/ not http://www.domain.com/index.html. Next add the 301 redirect code to redirect any old index.html pages to http://www.domain.com/

Test the redirect is working correctly by clicking on the home page link from all the internal pages of your website.

To implement a 301 redirect for all the above scenarios read How to redirect a website or web page and preserve your rankings

5. Redirect dynamic URLS

Many content management system (CMS) websites contain long URL strings such as
www.site.com/categories/pageid?brand=348H&model=8889KHl&color=554hY Even though search engines can index these long URLs it’s better to create a cleaner and friendlier version containing your main keywords. To achieve this implement a 301 redirect so a visitor will get redirected to a more memorable URL such as

For implementation read: How to 301 redirect dynamic URLS

Common uses for a 302 redirect

302 redirects are often confused with 301 redirects because website owners don’t know the difference. If you use a 302 redirect in place of a 301 redirect it could have an adverse affect on your web pages ie lose rankings. In most cases using a permanent 301 redirect is the correct method. Here are a few instances where you would use a 302 direct instead:

1. Temporarily move a web page

If you temporarily want to move a page from Site A to Site B use a 302 redirect. For example if you create a new page for a special promotion but don’t want to change the original product page use a 302 redirect. It will temporarily send traffic from the original product page to promotion page. After the promotion is finished you remove the 302 redirect so the original product page will be displayed.

How to implement a 302 redirect

Place the code below in your .htaccess file then upload it to the root of your server (same location as your home page).

Temporarily redirecting a web page

Redirect /file-name.html http://www.domain.com/temporary-directory/temporary-file-name.html

Temporarily redirecting a page in PHP

header(“Location: http://www.domain.com/temporary-address/temporary-file-name.html”);

2. Temporarily redirecting a directory
Redirect /directory http://www.domain.com/temporary-directory

3. Temporarily redirecting an entire site
Redirect / http://www.temporary-domain.com/

Related Articles
301 Redirect for Multiple Domains
How to Redirect a Web Page Using a 301 Redirect
301 Redirect PHP – How to redirect a PHP page or website

Need help with the Design, Redesign or SEO of your website?
Go to: Website Design Maryland


  1. I recently started a blog which is hosted at http://www.mysite.com/blog. It was suggested that I should point my users to my root domain. Right now I’m using a 302 redirect from mysite.com to mysite.com/blog. I trying to figure out the best strategy to maintain SEO and to not break the links that have been established.

  2. Throughout the years, marketing has changed. Blogging is nowadays a must when it comes to branding yourself whilst marketing your business or product.

  3. Hiya! Quick question that’s entirely off topic. Do you know how
    to make your site mobile friendly? My weblog looks weird when viewing from my apple iphone.
    I’m trying to find a template or plugin that might be able to resolve this problem.
    If you have any suggestions, please share. With thanks!

Speak Your Mind