Is there a way to set up a Domain Record in the.br registry for a particular URL folder?

Asked

Viewed 521 times

3

For example: I will register the site www.fulanodetal.com.br and I would like when accessing this domain to display the site www.meusistema.com.br/usuario/11

I have tried using iframe, Frameset but always have problems capturing URL later, because the url never changes in these cases. Anyway, is there any way to configure this in DNS?

  • Have you tried just redirect to the link www.meusistema.com.br/usuario/11 ?

  • For this I would add a tag in the html of www.fulanodetal.com.br, being like this: <meta http-equiv="refresh" content="5; url=http://www.meusistema.com.br/usuario/11"> after five seconds that accessor www.fulanodetal.com.br would be redirected to http://www.meusistema.com.br/usuario/11

  • 1

    Ola Eonardo, would be a solution, but would like to offer customers a more personalized option, without the idea that he "is user 11" understands?

  • Um, I understand, it would be a little complicated, it would have a shape but it would look like this usuario.meusistema.com.br, that would create a record CNAME in the DNS with the user name and point it to the ip or name of www.meusistema.com.br/usuario/11 and make the above scheme with html, but redirecting to usuario.meusistema.com.br... It would be like a subdomain of meu sistema.com.br.. But it would be complex because it would have to create several subdomains, one for each client and pointing to different records. But this would require a dedicated server, hosting providers usually don’t allow

  • 1

    is... in this case would be complex even because when the user registers everything is dynastic, would have to be created all automatically. Will not happen! To do what I need I would have to go to Angular and get everything via API, but for now it will not roll uhauha. Well, it was worth the idea.

  • tried using . htaccess to "camouflage" the URL, see: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

  • is true Peter, it may be a good idea, but I can tell you that http://www.meusistema.com.br/usuario/11 will be seen as http://www.meusistema.com.br/fulanodetal almenos certo?

Show 2 more comments

2 answers

1

If your system is PHP or some technolgoia otura in which you work only through the file system - (that is, your only access to the server is by FTP, or other technology to put files there) - the redirect using a hresposta HTTP - 301 is the only way to do that. (But in this case it’s still better to use a true 301 response than a static HTML file with a metatag for this - on limited access servers this is possible with PHP or a CGI script)

DNS will always point to an IP - (I currently believe that most records can point simultaneously to an Ipv4 and an Ipv6) - and what solves what will be the root of a given domain is your WEB server that listens on ports 80 and 443 (usually Apache or Nginx). So if you have access to the Web server configuration, you can perform the configuration you want.

The HTTP request arrives at the server with the desired domain information - and from there the configuration of it can modify the request so that it internally uses another URL (and modify the output data to restore the original domain).

Since it is a complex URL on another system and not simply a specific point with static files in the filesystem, with Apache you should use the mod_rewrite.

With Apache, it is possible to specify modrewrite redirect rules in files .htaccess that you have control even on a server that only has access to the filesystem. However, the redirect rule has to be in a file .htaccess located at the root of the domain that Voce wants to redirect to the internal URL: no access to the server configuration itself, the only way to do this is by hiring a separate account for the other domain - and then it’s better to give an HTTP 301 response anyway. (since nothing guarantees that the second account will be on the same IP and being served by the same server as the first)

In Nginx, Mod_rewrite functionality is at the core of the rule specification, and you can get an idea of where to start with the official rule documentation -but here are some examples of how to do a simple rewrite.

Remember that even if you only have access to the filesystem, if you understand what the rewrite rule would be in Apache/Nginx, it should be possible to ask your ISP to put the rule for you. It may cost extra - but it will certainly be less than hiring another account.

(Nowadays most people and -and the best web technologies require - a system where you have control at least at the shell level in this case it would be possible to create a separate root for the other domain and write one .htaccess - but better still is access to a VPS - in which you have full control including the webserver)

1

The short, thick answer is: there’s no way to set this up in DNS.

An elegant solution is to use virtual hosts on the web server.

Browser other questions tagged

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