where to place redirect from old website to new website

Home Forums BulletProof Security Pro where to place redirect from old website to new website

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #39886
    jenni101
    Participant

    Hello,

    I have a wp site that will be removed soon, but I still have the domain name.

    Should I add the redirect in cPanel?

    Or as a redirect in the bottom box in the htaccess custom code? (though not sure how to do this for a whole site).

    Or in the rewite engine custom code like this:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^oldsite.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.oldsite.com$
    RewriteRule (.*)$ https://www.some-other-domain.com/$1 [R=301,L]

    many thanks.

    #39887
    AITpro Admin
    Keymaster

    The answer depends on where the old site was installed and your hosting account folder structure. Post that information in your forum reply.

    Example:
    /public_html/ – is a WordPress website installed in your hosting account root folder?
    /public_html/old-site-installation-folder/
    /public_html/another-site-installation-folder/

    #39888
    jenni101
    Participant

    Thanks for your quick reply.

    My old site is with another hosting provider installed in the root like this: /public_html/

    And my new site is installed in it’s own sub-folder (GWIOD) like this: /public_html/new-site-installation-folder/

    Thanks.

    #39889
    AITpro Admin
    Keymaster

    You would create an htaccess file or use an existing htaccess file in the root hosting account where the old site is/was: /public_html/.htaccess and add your htaccess code that you posted above in that htaccess file.  Note: Since you are redirecting the entire old site to your new site you only need your redirect htaccess code in that htaccess file.

    #39894
    jenni101
    Participant

    Brilliant! Thank you.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.