[resolved] htaccess redirect from old to new domain (3 posts)

  1. paulgian
    Posted 1 year ago #

    Hi all,

    I have a website onlinediamondbuyingguide.com and had recently rebranded it to beyond4cs.com.

    The new site follows the same exact url structure as the old site. Is there any way to do 301 redirects so that all the old urls are pointing to the new site correctly?

    For example, I want to point =>
    http://onlinediamondbuyingguide.com/step-by-step-guide/ to http://beyond4cs.com/step-by-step-guide/

    I know how to do it one url at a time but it will drive me nuts as I have 100s of urls to make corrections to. Can anyone help with the correct coding to redirect all the pages at a time?

    Thanks in advance!

  2. Pioneer Web Design
    Posted 1 year ago #

    Yes, this can be achieved by adding this at the top of your .htaccess file of the old site:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^(.*)$ http://beyond4cs.com/$1 [R=301,L]

    Note: If you are now pointing a new domain name to the same hosted folder, create a new folder at host, add a copy of index.php (in site root folder) from current site, add a .htaccess file with above in it, and then point old domain to that folder. Consult host for help with that.

  3. paulgian
    Posted 1 year ago #

    Problem solved. Thanks alot Pioneer!


Topic Closed

This topic has been closed to new replies.

About this Topic