How to redirect a dedicated IP address to the domain name
AnsweredWe have a customer who (for some reason) wants to have his dedicated IP redirect to his domain.
We used the instructions in here:
We turned on 'Include' in the Apache configuration > global config and followed the instructions and edited the Pre VirtualHost configuration include file. The IP redirects properly, but we get 'not a secure connection', so we added another virtualhost w/ :443 to provide secure connection. Still getting a secure connection error. Nothing seems to affect it.
Logs show:
Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
Any thoughts?
-
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 -
What ffeingol said - there just isn't a way to secure that type of connection.
0 -
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 -
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 -
Incognito results in the same. Also changed all the security settings to allow redirects and non-ssl URIs. Same results.
0 -
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 -
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 - 403We 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 -
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.
Comments
8 comments