Menu
whm logo
  • News
  • Websites
  • Business
  • Servers
  • Services
    • CPanel Hosting
    • EZ Website Builder
    • VPS Hosting
    • Dedicated Servers
    • Reseller Hosting
    • Domain Registrstion
whm 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

Click to view coupon lup

Recent Posts

  • How to make an awesome about us page

    How to make an awesome about us page

    December 5, 2022
  • Is AI taking over SEO?

    Is AI taking over SEO?

    November 10, 2022
  • Transferring domains can be easy

    Transferring domains can be easy

    October 26, 2022
  • 6 highly effective ways to market a small business online

    6 highly effective ways to market a small business online

    September 28, 2022
  • A successful marketer

    A successful marketer

    August 22, 2022
  1. albertdavid123 on MySQL 5.5 is officially dying this weekApril 3, 2019

    Good bye 5.5. And thanks for we explaining the password change steps.

  2. Web Host Pro on Proper computer postureDecember 1, 2015

    Thanks!

  3. frank on 85% of people use the internet to find local businessesAugust 8, 2015

    I always do!

  4. Danny Walton on Free word invoice templateJuly 4, 2014

    Nice download

  5. Ken on Using Google Public DNSFebruary 22, 2014

    Great article!

All Rights Reserved Web Host Pro 2022