Redirect using .htaccess (Apache2)

0

I am using an Ubuntu server 16.04 server and it works with Apache2

I'm trying to do the following:

When a user visits my url cdn.mywebsite.com the .htaccess act and return 192.168.12.14/

Visitor - > cdn.mywebsite.com - > 192.168.12.14 /

I am using this code for redirects

Redirect 302 / http://192.168.12.14/

It works perfectly but what I want to achieve is that the visitor in his address bar does not see the IP address 192.168.12.14/ if not that%% of% is kept

How could I do it? Thanks!

    
asked by Jesus 26.10.2016 в 14:41
source

1 answer

0

Redirection occurs at the browser level. There is no way to achieve what you ask for using a redirect.

Therefore, the direct answer to your question is:

No

you can not achieve, by doing a redirect, the browser keep the previous address in the address bar.

Other alternatives:

However, if it is possible to achieve what you are looking for, in different ways, for example embedding the target site in an empty html that resides on your server, or also receiving an http request on a server and process said request on another server. To give you a 100% effective answer, however, you would need to know more details of how you want / need the whole issue to work. Since that is beyond the scope of this response, I suggest reading about:

answered by 26.10.2016 в 15:32