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)
Have you tried just redirect to the link
www.meusistema.com.br/usuario/11
?– Leonardo
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 accessorwww.fulanodetal.com.br
would be redirected tohttp://www.meusistema.com.br/usuario/11
– Leonardo
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?
– Fábio Duarte
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 recordCNAME
in the DNS with the user name and point it to the ip or name ofwww.meusistema.com.br/usuario/11
and make the above scheme with html, but redirecting tousuario.meusistema.com.br
... It would be like a subdomain ofmeu 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– Leonardo
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.
– Fábio Duarte
tried using . htaccess to "camouflage" the URL, see: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
– Pedro Soares
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?
– Fábio Duarte