I'm an extreme novice at Apache, but I am trying very hard and doing my best to learn. However I've run up against an issue and although I've searched extensively (spent the last 3+ hours trying different things to try to make it work, lol), I've still been unable to find anything that does exactly what I need. However, (I think) this should be extraordinarily simple question for someone more versed in this than I.
What I'm needing is a simply RewriteRule that will take a URL (https://sample.example.com/login.htm?page=%2F), and when visited, redirect/change it to "https://sample.example.com/login.htm?page=%2Fui2.htm). I've tried rewrite rules, redirects, conditions, etc....but nothing I do gets there perfectly. I feel like I'm really, really, really close but I can't quite cross that last step. Here's what I have in the virtual host file this site matches to:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName sample.example.com
ServerAdmin webmaster@localhost
SSLCertificateFile /etc/letsencrypt/live/sample.example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/sample.example.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
RewriteEngine on
RewriteRule "^/login\.htm$" "/login.htm?page=%2Fui2.htm" [R,L]
ProxyRequests Off
ProxyPreserveHost On
<Location />
ProxyPass http://192.168.x.x:38374/
ProxyPassReverse http://192.168.x.x:38374/
</Location>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
</IfModule>
(the internal IP and domain names above are obviously masked)
I know the input text for the rewrite is working with certainty, it's just the re-written part that's failing. Everything works, except that it redirects me to https://sample.example.com/login.htm?page=Fui2.htm (i.e. it removes the "%2" part). Therein lies my problem.
[NE,B,R,L]