I have requirement where user will type url like http://example.com/Welcome
in browser, but I need to send it to http://myip.com/someapp/next.html
, so I wrote virtual host in httpd.conf file:
<VirtualHost *:80>
ProxyRequests off
ProxyPreserveHost On
RewriteEngine On
RewriteRule "^/(.*)" "http://myip.com/someapp/next.html" [P]
ProxyPassReverse "/" "http://myip.com/someapp/next.html"
</VirtualHost>
This is working partly. When user enter url http://example.com/Welcome
it is being replaced with http://example.com
. How can I keep complete url (http://example.com/Welcome
)? would appreciate any help.
EDIT: Here is the access_log surrounding the call
184.180.123.46 - - [06/Dec/2017:21:10:41 +0000] "GET /myip.com/images/logo.png HTTP/1.1" 200 6697 "http://example.com/Welcome" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36"
184.180.123.46 - - [06/Dec/2017:21:10:51 +0000] "POST /myip/somepage HTTP/1.1" 200 7 "http://example.com/Welcome" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36"
184.180.123.46 - - [06/Dec/2017:21:10:52 +0000] "GET / HTTP/1.1" 200 3391 "http://example.com/Welcome" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36"
184.180.123.46 - - [06/Dec/2017:21:11:01 +0000] "GET / HTTP/1.1" 200 3391 "http://example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36"