Article 6CY5P apache redirect to domain name

apache redirect to domain name

by
1s440
from LinuxQuestions.org on (#6CY5P)
Hi all,

I would need to redirect webpage from IP(https://ip) to domain name(https://domain.com) instead. I placed the below redirect rule. unfortunately redirect the webpage from ip doesnot work for https but works with http. Can anyone suggest.

I also followed the below article.

https://www.ezeelogin.com/kb/article...linux-525.html
Code:RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^xx.xx.xx.xx$
RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L,NE]

RewriteCond %{HTTP_HOST} ^xx.xx.xx.xx$
RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L,NE]
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments