IIS URL redirection

Asked

Viewed 1,298 times

-1

I’m having problems with redirecting here at the company, it’s as follows:

I have a server IIS where I have the current website of the company and within this site I have webservices running, using a domain ???.com.br at gate 80.

My doubt is that I hired a company to create a new website and my company’s website will stay in a subdomain of this company that I hired and would like when someone type www.???.com.br (my domain) it is redirected to the subdomain of the company I hired to develop the new site, bigger problem is that when typing my domain the user will have to come in my IIS to then be redirected, because I can’t redirect my domain to the subdomain of the company that made the new site because I have mine webservices running in the same domain www.???.com.br

Can someone give me a light on how to solve this problem? Confusing the most I think I could understand.

1 answer

0

There are many ways to redirect to another page, regardless of whether they are in the same domain.

1) If your domain points to an HTML page, for example, you can include the meta tag below within the head:

<meta http-equiv="refresh" content="0;http://subdominio.dominio.com.br">

It is probably the best method, as it is simple and works even if the client browser is disabled with Javascript.

2) You can redirect using Javascript:

<script language=javascript>
    function redirect(){
        window.location.href = "http://subdominio.dominio.com.br";
    }
</script>

<body onload="redirect()">
    <!-- Qualquer conteúdo no body não será exibido, uma vez que a página será redirecionada -->
</body>

3) If the page is ASP you can use:

<% Response.Redirect ("http://subdominio.dominio.com.br") %>

4) If the page is PHP you can use:

<?php header('location: http://subdominio.dominio.com.br');

Among other forms.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.