• GoDaddy Community
  • Managed WordPress Hosting
  • Managed WordPress Hosting

    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    Go to solution

    How to redirect old domain to new domain on HTTPS protocol in .htaccess

    As mentioned by a community manager in this post:  https://www.godaddy.com/community/Managing-Domains/Forwarding-from-HTTPS/m-p/126407/highlight/true#M..., the domain forward cannot be used for websites on the HTTPS protocol (which should be all websites in 2019).  So the solution is to set up redirects on the server. However, the  normal redirect methods that work on almost any other host are not working so how is one suppose to set up a redirect when using GoDaddy's Managed WordPress Hosting.


    This is what my .httaccess currently looks like:


    <IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_USER_AGENT} ^(.+)$
    RewriteCond %{SERVER_NAME} ^olddomain\.com$
    RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
    Header add Strict-Transport-Security "max-age=300"
    # END GD-SSL
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress


    Using the recommended redirect found at: https://www.godaddy.com/help/using-301-page-redirects-234 which is:

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

    or a simple direct such as:

    Redirect 301 / https://newdomain.com/

    Will result in only one of 4 versions of my domain to be redirect:


    https://olddomain.com/  has no redirect

    https://www.olddomain.com/  redirects to https://olddomain.com

    http://olddomain.com/  redirects to https://olddomain.com

    http://www.olddomain.com/ redirect to https://newdomain.com


    Only the last version redirect to the new domain. How can I make all versions redirect to the new domain?


    1 REPLY 1
    Super User III
    Super User III

    Re: How to redirect old domain to new domain on HTTPS protocol in .htaccess



    I see that this hasn't been replied to, so I figured I'd jump in.


    The Managed WordPress platform works slightly differently than your typical cPanel or VPS server as the domain mapping is handled at the platform level


    If I understand your post correctly you have

    1) olddomain.com and newdomain.com

    2) You have an SSL certificate for newdomain.com 

    3) You want to olddomain.com to forward to newdomain.com 



    1) What do you have setup as the primary URL www.newdomain.com or newdomain.com - you should check both the hosting panel and the general settings in WordPress - this will affect if you are seeing with or without the www


    2) Did you have an SSL certificate on olddomain.com - if so you more than likely will need to use a service like CloudFlare (free) to forward the old domain to the new domain - this is because the Managed WordPress platform only allows for the primary URL to have an SSL certificate and so when traffic comes in over a 2nd URL looking for HTTPS it doesn't redirect


    3) If you didn't have an SSL certificate for olddomain.com, I suggest using the Domain Forwarding feature in the GoDaddy Domain/DNS management 







    I am a GoDaddy End User - Just Like You
    Check out my site! | I currently manage over 300 WordPress Websites
    * Please note that I offer free advice on this forum. If you would like personalized help, please contact me. Otherwise, please ask your question in the proper forum so the answer can assist EVERYONE in the community and not just you. Thanks! *

    Once your issue is resolved,
    please be sure to come back and click accept for the solution

    Get Better Support on the Community Boards!
    Etiquette When Asking for Help from the Community