Skip to main content

How to redirect a dedicated IP address to the domain name

Answered

Comments

8 comments

  • ffeingol

    I don't believe there is any what to get around this.  You can't get SSL certs issues for IP addresses, only domain names, so if you access an IP securely, you'll get the SSL error.  After that it's not wort trying to fix the too many redirects issues.

    1
  • cPRex Jurassic Moderator

    What ffeingol said - there just isn't a way to secure that type of connection.

    0
  • jndawson

    Update: We removed the pre-virtual host configuration. Using Chrome resulted in rendering the directory index (as it did before we attempted changes). However, using Firefox and the IP redirects to the https domain and everything works wonderfully well. Changing the domain to non-ssl doesn't affect the Chrome results.

    There is nothing obvious in Chrome or Firefox that indicates why the difference. Does anybody have any insight into that?

    0
  • cPRex Jurassic Moderator

    I don't have a good explanation for those differences.  Is there perhaps some browser caching involved with Chrome?  You can always try testing in an incognito session to confirm if that could be part of the issue.

    0
  • jndawson

    Incognito results in the same. Also changed all the security settings to allow redirects and non-ssl URIs. Same results.

    0
  • cPRex Jurassic Moderator

    Is the issue only with Chrome?  What about other options like Edge or Brave of Safari, or mobile versions?  If so, I'm not sure there is much that can be done from a cPanel perspective.

    0
  • jndawson

    We added back the include file:

    <VirtualHost 12.34.56.78:80>
    ServerName domain.tld
    ServerAdmin customer@domain.tld
    DocumentRoot /home/customer/public_html

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^12\.34\.56\.78$
    RewriteRule ^/(.*)$ https://domain.tld/$1 [L,R=301]
    </IfModule>
    </VirtualHost>

    Here's what we've got so far:

    Windows Firefox - redirects to https
    Windows Chrome - 403
    Windows Brave - redirects to https
    iPhone Google - redirects to http, 'not secure', no bypass option
    iPhone Safari - redirects to http, 'not secure', no bypass option
    Android Firefox - redirects to https
    Android Google - redirects to https
    Android Chrome - 403

    We spent a lot of time researching Chrome and testing configuration/settings options. It seems the Chrome people definitely don't want to redirect IP addresses to domain names. We couldn't find anything regarding httpd.conf/.htaccess that would provide whatever header info Chrome is looking for.

    1
  • jndawson

    Update -  Desktop Windows Chrome

    Set TLS to v1.2, be sure redirect is allowed. We are getting mixed results, but some computers redirect to https while others do not.

    0

Please sign in to leave a comment.