Redirect/rewrite url with apache reverse proxy

apache-2.4redirectreverse-proxyrewrite

I have a problem that i don’t know how to resolve.
I’ve got one server for reverse proxy and another one for a wiki hosting on apache2 web server.

The wiki access is provide through the reverse proxy (security enhancement etc) and RP is the only that is NATed (Internet access).

My wiki only listen on url « https ://wiki.mylab.lab » (can't change that).
But the URL access for users has to be « https ://dtd-wiki.xx.yyy.zzzz.com »

I must redirect/rewrite/pass « https ://dtd-wiki.xx.yyy.zzzz.com » to « https ://wiki.mylab.lab » with the RP and I don’t know how to do that.

Currently my RP is configured to provide the access to the wiki with the url « https ://wiki.mylab.lab ».

Here a schema for better comprehension

I don't know if I have to use mod_rewrite or other mod. I'm lost in my researchs so I ask the question here.

Thanks for the help.

Edit : for my wiki, HBruijn's answer worked but with other service (moodle server), I have this :

GET https://dtd-elearning.xx.yyy.zzzz.com/login/index.php [HTTP/1.1 200 OK 75 ms]
GET https://moodle.mylab.lab/theme/yui_combo.php [250 ms]
GET https://moodle.mylab.lab/theme/styles.php/clean/1461935313/all [0 ms]
GET https://moodle.mylab.lab/theme/yui_combo.php [0 ms]
GET https://moodle.mylab.lab/lib/javascript.php/1461935313/lib/javascript-static.js [0 ms]

The index.php is good but other php, js and other files load from bad url (mylab.lab). Can I fix that with Apache Reverse Proxy ?
Edit : according to moodle doc, I must change the config of my moodle and put the external url in the config.php file.

Best Answer

Unless I completely misread your question and diagram the only difference between the your before and after is the ServerName, all the other info is already there...

That makes the end result for your reverse proxy something along the lines of

<VirtualHost *:443> 
  ServerName dtd-wiki.something.example.com
  ProxyPass / https://wiki.mylab.lab
  ProxyPassReverse / https://wiki.mylab.lab
  #Other options
</VirtualHost>