INFO Subdomínios vs Hosts Virtuais

Brazuka

Well-known member
Joined
Apr 14, 2021
Messages
34
Awards
4
Offline
Subdomains vs. Virtual Hosts

It is important to understand the difference between subdomains and VHosts as it can affect how your site is accessed and how search engines index your site. If you are not using the right type of hosting, this can also affect your website speed and performance and even make you vulnerable to cybersecurity vulnerabilities such as DNS hijacking, SSL certificate vulnerabilities and cross-site scripting.

subdomain

A subdomain is a second-level domain that is part of a larger domain. For example, if you have a website at example.com, you can create a subdomain at subdomain.example.com. A subdomain can be used to create a separate website or to point to a different website or directory on the same server.

Virtual Host

A Virtual Host (VH) is an Internet hosting service that allows organizations to host their websites on a single server. A VH can be used to host multiple websites, each with its own domain name, or it can be used to host multiple websites that share the same domain name. VHosts may or may not have public DNS records, so to access your website you may need to change the hostnames and addresses in your localhost (typically located at) etc/hosts or use the header of a standard HTTP request.
I believe that for our field of work, like me, many use vps or dedicated servers to host their work, because it is something more private and better manage the operating system and software and extensions, because MY OPINION is that we started using Virtual Host, because it allows us to create hosts for each client, for example:
Client 1 – Smartersads.com
Client 2 – smartershd.com
Let's assume that our server has the following ip: 12.345.6.789 and apache has been installed, which is the most used today, but there are NGINX and LiteSpeed Web Server, both clients will use the same ip to connect to the server, but their hosts will be separate:
/var/www/smartersads.com/public_html
/var/www/smartershd.com/public_html
Therefore, if desired, the customer can use their own domain to manage the panel or system provided by us. And after the customer places www.smartersads.com or smartershd.com in their browser, they will be shown their contracted product, enabling more invisibility on our servers and customers, as I often see people on the internet who simply create folders and place their files in the root of the host, being visible to all their work. If so, I can create a manual on how to create a virtual host on vps or dedicated servers.
And finally, for those who use shared hosting, use a basic index file in the root of your host for your root page to be blank for example: example.com/smarters on that page there will be a panel already in example.com it will be blank because it has an index file with nothing.

index.html template

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title> </title>
</head>
<body>
<h1>THERE'S NOTHING FOR YOU HERE</h1>
</body>
</html>
 
Top