I have read many examples that use the .htaccess file method to mask a url. None of them works for me. It might be something simple that I am missing. Please bare with me.
Here is what i want to do:
I have a subdomain under a dns name, lets say it is mysub.domain
. I have an index.html
file there that redirects lets say to mycomplex.dns.site
. The redirection is done successfully via
<meta http-equiv="refresh" content="0;url=http://mycomplex.dns.site:8081" /> in my index.html
When the page is loaded in Firefox, the url on the address bar, says http://mycomplex.dns.site:8081
.
I don't want this I would like to show mysub.domain
, so I created a .htaccess file in the /var/www/html target directory that says:
RewriteEngine On
RewriteRule "^/mycomplex.dns.site:8081$" "http://mysub.domain/intex.html" [R]
And this doesn't work! I keep getting the url as mycomplex.dns.site:8081
I have tried to redirect with a .htaccess redirection in mysub.domain
which works but the target mycomplex.dns.site
url description remains.
The subdomain is in a provider where I have no apache2 control. The host computer with the complex name is in a raspberry with apache2. There I can control things and apache2. I have tried many variations but it doesn't work. Should it be something is Apache2 config files?