0
votes

Im trying to resend a request using HTTPS when a particular URL is hit. This is my rule, however it does not cause the request to be resent. Any ideas what is wrong with it?

RewriteCond %{SERVER_PORT} 15000

RewriteCond %{REQUEST_URI} ^/securePage$

RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [NC,R=301,L]

The securePage value is a vanity URL which is supposed to get rewritten when the request is sent for the second time using the new protocol

Thanks,

1
The issue was with the port number i was listening on. While my apache server was listening on this port for SSL requests it seems that the rewrite engine still sees it as port 80 - cdugga

1 Answers

3
votes

Changing the port i was listening on fixed the issue

RewriteCond %{SERVER_PORT} 80