I re-post my question in the event that I will be more clear as to what I would like to do.
I have a subdomain under a dns name, lets say it is mysub.domain
. This subdomain is in a remote provider where I have no apache2 control. The file system available has an index.html file that can redirect to a web page (just one html page), lets say to mycomplex.dns.site:8081
.
This latter site resides in an rpi that I have full control ie Apache2/php/etc.
The redirection is done successfully via
<meta http-equiv="refresh" content="0;url=http://mycomplex.dns.site:8081" />
in my index.html.
To summarize, I write mysub.domain
in the URL command line and after the redirection I see http://mycomplex.dns.site:8081
in the url line.
That is not what I want. I would like to keep showing mysub.domain
.
How do I do this? I googled and found this solution involving .htaccess:
RewriteEngine On
RewriteRule "^/mycomplex.dns.site:8081$" "http://mysub.domain/intex.html" [R]
This doesn't work , I keep getting the url as mycomplex.dns.site:8081
.
Is it some misspelling in the .htaccess file or I am missing the point of masking? I suppose that this .htaccess is in the target directory /var/www/html/
Should I add the server name mysub.domain
in apache2 virtual config file, but again I tried this and it didn't work.