If you are using Apache for the web server software, you can use DocumentRoot /var/www/html/MyWebsite/Code/web in a VirtualHosts section of the the Apache configuration file, /etc/httpd/conf/httpd.conf, to point to that folder as the root of your website.
E.g., you could include something like the following at the bottom of httpd.conf:
<VirtualHost *:80> ServerName mysite.com ServerAlias www.mysite.com ServerAdmin webmaster@mysite.com DocumentRoot /var/www/html/MyWebsite/Code/web ErrorLog /var/www/html/MyWebsite/logs/error.log CustomLog /var/www/html/MyWebsite/logs/transfer.log common </VirtualHost>
If you are unfamiliar with the VirtualHost section, you can have multiple websites on one web server using VirtualHost sections in the httpd.conf file. The DocumentRoot directive specifies the directory to be used for the top-level, i.e., "root", for the website for mysite.com. You can also specify where individual error and transfer logs for this particular website should be located (create the "logs" directory first, if it doesn't exist). And you can specify a contact email address, which can be anything you like, for ServerAdmin. Using ServerAlias www.mysite.com allows either mysite.com or www.mysite.com to work, provided you have DNS configured to point www.mysite.com as well as mysite.com to the IP address of your server. After making changes to the httpd.conf file, restart Apache.
Additional information on using virutal hosts with Apache can be found at Apache Virtual Host documentation.
Да, я использую * Apache *. Не могли бы вы объяснить, как я мог бы сделать это более подробно? Моя версия Apache 2.4.7.