Apache mod rewrite rule issue
-
29-10-2019 - |
Frage
I am trying to write a mod_rewrite rule for my apache server. My requirement is that I have three web applications on a server, out of which all request to HTTP scheme should be redirected to HTTPS.
Here's what I have written :
RewriteEngine On
RewriteCond $1 ^abc$ [NC]
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
This doesn't seems to be working fine. I am trying to run application with abc
context root to run on HTTP and all other requests to be redirected to HTTPS URL.
Can anyone tell me what am I doing wrong.
Keine korrekte Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow