Announcement

Collapse
No announcement yet.

How redirect IP address to the domain which uses SSL?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How redirect IP address to the domain which uses SSL?

    I want to redirect my IP address to the domain which uses SSL.
    I have written the following lines in the .htaccess file.

    Code:
       RewriteCond %{HTTP_HOST} ^123\.123\.12\.123$
       RewriteRule ^(.*)$ https://MyDomain.com/$1 [L,R=301]
    Redirection works fine but I'm getting the SSL Certificate error.

  • #2
    It may be supportive to explain you’re perceptive for this redirect. You would get be a better solution.

    Comment


    • #3
      You have required a valid SSL Certificate for 123.123.12.123 which is improbable.

      What you likely have to do is:

      1) Make a VirtualHost entry matching 123.123.12.123 as ServerName, but http as an alternative, however not using https.
      2) Redirect it to your domain.

      You may also consider with mod_alias instead of mod_rewrite, which is considered as the help options in this situation, see more When not to use mod_rewrite.

      Comment

      Working...
      X