I have just deployed apache 2.4 and i defined a virtual host tag to redirect to a specific url. The problema is my url includes a "?" character and Apache change it to "%3F". Here is my actual Virtual host configuration tag:
<VirtualHost *:80>
ServerName http://app2x.example.com
RewriteEngine On
ProxyRequests Off
ProxyPreserveHost On
ErrorLog "logs/app2x.example.com-error.log"
CustomLog "logs/app2x.example.com.log" common
ProxyPass /sib http://172.168.100.3:9097/sib/f?p=103:1
ProxyPassReverse /sib http://172.168.100.3:9097/sib/f?p=103:1
</VirtualHost>
as you can see there is a "?" character in url, but when i test it i get next error :
/sib/f%3Fp=103:1 start: 2020-04-21T17:37:53.992Z duration: 16ms
URLMappingNotFoundException [statusCode=404, reasons=[The request could not be mapped to any database. Check the request URL is correct, and that URL to database mappings have been correctly configured]]
I have tested with this url:
ProxyPass /sib http://172.168.100.3:9097/
and work just fine, but i need to redirect to full shown url
I am Using windows 2019 server STD Edition 64 bits with Apache 2.4.43 and the URL i am pointing to is in another similar machine.
i am new using Apache and have not found an answer on google to solve it, any help will be appreciated. Thanks
i have just fixed my issue (after a couple of days googling and trying), i made it work. I have to use RewriteRule as follows:
1.) my httpd-vhosts.conf file looks like this:
<VirtualHost *:80>
ServerName http://app2x.example.com
RewriteEngine On
RewriteRule ^/sib$ sib/f?p=103:1 [R=301] # => everything that contains "/sib" redirect to url: "sib/f?p=103:1"
RewriteRule ^/([a-zA-Z0-9]+)$ sib [R=301] # => everything that contains "/any letter or number" redirect it to sib, that, at same time, will redirect it to url: "sib/f?p=103:1"
ProxyRequests Off # => so the server does not work as a normal proxy
ProxyPreserveHost On # => important to keep url format from oracle apex server, if not, will display errors when using the app because apache will change the deeper url's
ProxyPass / http://172.168.100.3:9097/ # => important do not forget this last "/"
ProxyPassReverse / http://172.168.100.3:9097/
</VirtualHost>
2.) don't forget to enable mode rewrite line in file: httpd.conf, so the previous config can work
Enable this line => LoadModule rewrite_module modules/mod_rewrite.so
Thats it!, happy coding
Majv