I have a redirect rule :
<VirtualHost *:80>
ServerAdmin webmaster@localhost
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>
<VirtualHost *:7080>
ServerAdmin webmaster@localhost
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^/?(.*) https://merchant.juspay.in/$1 [R,L]
RewriteCond %{SERVER_NAME} demo.juspay.in
RewriteRule ^/?(.*) https://merchant.juspay.in/$1 [R,L]
</VirtualHost>
<VirtualHost *:8080>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://api.juspay.in
</VirtualHost>
in apache. I need to a way to write a rule such that port 80 of my ip ( localhost ) shouldn’t be redirected to 8443.
How can I do that?
If you want to catch traffic coming in on HTTPS (port 443) you will need another virtualhost that listens on this port. Just use the same directory and settings (and a SSL cert) and you’re good.
You don’t need to do the RewriteRule. Apache will know what vhost to use to serve your files based on the protocol of the request.