OK so... I have the following URL which works on my site:
http://my_domain.net/w/mRD3nKkM
The rewrite for this in the root of my site is:
RewriteRule ^([w])/(\w+)$ res/$1/response.php?id=$2 [L]
Simple stuff and works a treat. Now I want to redirect any traffic that hits that URL unencrypted to go over https, like below:
https://my_domain.net/w/mRD3nKkM
So I put another .htaccess file within the res/w/
folder conatining the following:
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{REQUEST_URI} ^/response.php$
RewriteCond %{QUERY_STRING} ^id=(.*)$
RewriteRule ^(.*)$ https://my_domain.net/w/$1 [R,L]
To my miind this should work, but doesn't.
To be clear, I have the following URL rewrite working:
http://my_domain.net/w/mRD3nKkM
and I would like it to look like this:
https://my_domain.net/w/mRD3nKkM
Thanks