Menu
web host pro logo
  • News
  • Websites
  • WordPress
  • Business
  • Dedicated Servers
  • Services
    • CPanel Hosting
    • EZ Website Builder
    • VPS Hosting
    • Dedicated Servers
    • Reseller Hosting
    • Domain Registrstion
web host pro logo
May 14, 2013

301 and 302 redirect

Share it here
twitter facebook pinterest linkedin

301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It’s not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it’s the safest option. The code “301” is interpreted as “moved permanently”.

Here is a link from Google and a video on this: 301 redirect

There is several diffent ways to do a 301 or 302 redirect but the best way is with htaccess as shown here:

Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Please REPLACE domain.com and www.newdomain.com with your actual domain name.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

If you get an error then remove everything from your .htaccess file and add it piece by piece to see what causes the error.

 

Continue Reading

.htaccess info, tricks, and tips →

Connect with us
twitter facebook instagram youtube pinterest linkedin

Recent Posts

  • Internet Speeds and Costs Around the World (2010)

    Internet Speeds and Costs Around the World (2010)

  • Top 5 WordPress shopping carts

    Top 5 WordPress shopping carts

  • Email ports 25 26 587

    Email ports 25 26 587

  • Using Google Public DNS

    Using Google Public DNS

  • Who are people using for advertisers on their blogs?

    Who are people using for advertisers on their blogs?

  • Validate your website

    Validate your website

  • What is the Secure Connection Failed Server that uses an invalid security certificate error?

    What is the Secure Connection Failed Server that uses an invalid security certificate error?

  • Internet usage around the World 2009-2028 (revised)

    Internet usage around the World 2009-2028 (revised)

  • Impostor scams are on the rise

    Impostor scams are on the rise

  • How to make an awesome about us page

    How to make an awesome about us page

  • Is AI taking over SEO?

    Is AI taking over SEO?

  • Transferring domains can be easy

    Transferring domains can be easy

  • 6 highly effective ways to market a small business online

    6 highly effective ways to market a small business online

  • A successful marketer

    A successful marketer

  • Updates around the web

    Updates around the web

All Rights Reserved Web Host Pro 2023