Skip to main content

Redirect SSL Domain A to SSL Domain B

Comments

6 comments

  • quizknows
    Are you dealing with parked/addon domians or does exampleA.com have its own document root (i.e. it's own public_html dir) edit; this may or may not help you due to ssl differences and such, but to carry over the domain name this works:
    RewriteEngine On RewriteCond %{http_host} ^domainA.com [NC] RewriteRule ^(.*)$ http://www.domainB.com/%{http_host} [R=301,L]
    This ends up functioning as if you visit domaina.com you end up at domainB.com/domainA.com
    0
  • cPanelMichael
    This is a trivial task under IIS and in terms of Linux, I have personally tried every conceivable way I know of to force a said redirect but always reach the "/" forbidden page although cPanel's built in redirection works for non-SSL redirection to the second SSL site.

    Hello :) Could you let us know the specific error message in /usr/local/apache/logs/error_log when you reach the forbidden message in your browser? Thank you.
    0
  • Avalon
    Are you dealing with parked/addon domians or does exampleA.com have its own document root (i.e. it's own public_html dir) edit; this may or may not help you due to ssl differences and such, but to carry over the domain name this works:
    RewriteEngine On RewriteCond %{http_host} ^domainA.com [NC] RewriteRule ^(.*)$ http://www.domainB.com/%{http_host} [R=301,L]
    This ends up functioning as if you visit domaina.com you end up at domainB.com/domainA.com

    Unfortunately, this is one of the first things I tried but I tried it again to just make sure. No joy unfortunately: the server lands on the forbidden page with SSL. To answer your question: yes, each domain has its own document root and thus a separate account for easier manageability and enterprise mobility. In the end though, we are still talking about redirecting 25 domains to a 26th domain as well as a very specific page within the 26th domain. I can't believe how stubborn its being on the CloudLinux box. On Win 2K12 R2 DC, getting such a redirect setup took all of maybe 5-6 clicks. Each of the 25 domains have valid certificates as does the 26th.
    Hello :) Could you let us know the specific error message in /usr/local/apache/logs/error_log when you reach the forbidden message in your browser? Thank you.

    Most certainly.This was the last log entry made by Apache at around the time the domain was accessed for redirection (SSL to SSL):
    [Wed Dec 02 03:59:26.395551 2015] [lsapi:notice] [pid 829769:tid 139637097989888] [client SERVER IP AND PORT REMOVED] [host domainB.com] apr_table__get(REDIRECT_STATUS) ret ((null))
    Edited to make correction to Apache log: shows the destination domain ("domainB.com") and not the origin domain ("domainA.com"). Server IP is also displayed as the IP to the destination domain which has its own dedicated uplink as well as a really high number port (50000's)
    0
  • quizknows
    You could always put an index.php in each document root with this code, so it wouldn't care if the initial visit was http or https:

    0
  • Avalon
    You could always put an index.php in each document root with this code, so it wouldn't care if the initial visit was http or https:


    Okay, strike everything I said. It seems that this problem stemmed from the fact that our Network Authority never issued the certificate for the domain until today so CloudFlare Enterprise didn't recognize it as a valid SSL certificate under strict settings. Now that the certificate has been issued, it does, and rather than reaching the forbidden page it redirects to the proper target domain. I guess when you are working with so many domains and servers sometimes the small things are just assumed and thus overlooked.
    0
  • cPanelMichael
    I am happy to see the issue is now resolved. Thank you for updating us with the outcome.
    0

Please sign in to leave a comment.