Score:0

masking after redrection using .htaccess

us flag

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?

in flag
Of course it doesn't work. You can't hide a port via .htaccess file.
thermike avatar
us flag
What if we won't hide the port number? Can we make it work like `mysub.domain:8081`
thermike avatar
us flag
@Gerald Schneider 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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.