Top VPS Hosting Provider

Welcome to the myhosting.com Forums.
+ Reply to Thread
Results 1 to 6 of 6

Thread: 301

  1. #1
    Rusher is offline Master Member
    Join Date
    May 2010
    Posts
    544

    Default 301

    How do you set up a 301 redirect on your web site?

  2. #2
    suwunk is offline Super Moderator
    Join Date
    Aug 2010
    Posts
    1,096

    Default

    if your site is hosted on a Linux Server you can use .htaccess for redirection
    Redirect Old domain to New domain
    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
    Redirect to www
    Code:
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
    if your site is hosted on a Windows Server you can use IIS Redirect
    Code:
    *In internet services manager, right click on the file or folder you wish to redirect
    *Select the radio titled "a redirection to a URL".
    *Enter the redirection page
    *Check "The exact url entered above" and the "A permanent redirection for this resource"
    *Click on 'Apply'
    You can also use server-side scripting for redirection

  3. #3
    jimbaum is offline Silver Member
    Join Date
    Jul 2008
    Location
    Washington State
    Posts
    31

    Default

    Thank you for the above advice.

    The below code you gave above worked for me in an .htaccess redirect.

    Jim B.

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]

  4. #4
    jeremya is offline Administrator
    Join Date
    Jun 2008
    Posts
    271

    Default

    In a shared windows hosting account that does not have direct access to IIS, you can create a redirect using your web.config file in the root of your website. Create that file and insert the code mentioned here:
    http://myhosting.com/kb/Create_301_redirects_in_onCloud
    -Jeremya

  5. #5
    jeremya is offline Administrator
    Join Date
    Jun 2008
    Posts
    271

    Default

    In a shared windows hosting account that does not have direct access to IIS, you can create a redirect using your web.config file in the root of your website. Create that file and insert the code mentioned here:
    http://myhosting.com/kb/Create_301_redirects_in_onCloud
    -Jeremya

  6. #6
    greenmatter is offline Master Member
    Join Date
    Jan 2010
    Posts
    307

    Default

    an important point worth repeating twice



 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts