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]
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]