Apache redirection

Hi,

I have a setting below in my httpd.conf

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^yapp-dev.abc.com$[OR]
RewriteCond %{HTTP_HOST} ^zapp-dev.abc.com$
RewriteRule ^(.*)$ https://zapp-dev.abc.com/$1 [R=301,L]
 

Result:
(with https) yapp-dev.abc.com >> URL redirected to (https) yapp-dev.abc.com [which IT NOT WORKING , it remain yapp instead zapp]

Can anyone advise? Thanks.

Try breaking this up into two rules and see how it works:

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^yapp-dev.abc.com
RewriteRule ^(.*)$ https://zapp-dev.abc.com/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^zapp-dev.abc.com$
RewriteRule ^(.*)$ https://zapp-dev.abc.com/$1 [R=301,L]