


About domain name introduction:
Generally speaking, a complete domain name is composed of two or more parts, and each part is separated by an English period "." For example, "www.baidu.com", the right part of the last "." ".com" becomes the top-level domain name (TLD), and also becomes the first-level domain name, similar to .cn, .net, .org, .gov, . edu, .tv, etc. Here .com.cn is actually the second-level domain name under .cn). Any individual can register a .com domain name, of which baidu.com is the second-level domain name under the top-level domain name .com. baidu.com can also be in the form of image.baidu.com, music.baidu.com, and imagemusic here can Called a "subdomain name";
Apache configuration for second-level domain names and subdomains:
Enter Apache-conf-extra-httpd-vhost.conf and add the following configuration:
<span style="color: #0000ff;"><span style="color: #800000;">VirtualHost </span><span style="color: #ff0000;">*:80</span><span style="color: #0000ff;">></span><span style="color: #000000;"> DocumentRoot "E:/wamp/www/galaxyPHP/" ServerName testimmi.com ServerAlias m.testimmi.com </span><span style="color: #0000ff;"><span style="color: #800000;">Directory </span><span style="color: #ff0000;">"E:/wamp/www/galaxyPHP/"</span><span style="color: #0000ff;">></span><span style="color: #000000;"> Allow from all </span><span style="color: #0000ff;"></span><span style="color: #800000;">Directory</span><span style="color: #0000ff;">></span> <span style="color: #0000ff;"><span style="color: #800000;">IfModule </span><span style="color: #ff0000;">dir_module</span><span style="color: #0000ff;">></span><span style="color: #000000;"> DirectoryIndex mobile.php index.html index.htm default.php default.htm default.html </span><span style="color: #0000ff;"></span><span style="color: #800000;">IfModule</span><span style="color: #0000ff;">></span> <span style="color: #0000ff;"></span><span style="color: #800000;">VirtualHost</span><span style="color: #0000ff;">></span> <span style="color: #0000ff;"><span style="color: #800000;">VirtualHost </span><span style="color: #ff0000;">*:80</span><span style="color: #0000ff;">></span><span style="color: #000000;"> DocumentRoot "E:/wamp/www/galaxyPHP/" ServerName testimmi.com ServerAlias www.testimmi.com </span><span style="color: #0000ff;"><span style="color: #800000;">Directory </span><span style="color: #ff0000;">"E:/wamp/www/galaxyPHP/"</span><span style="color: #0000ff;">></span><span style="color: #000000;"> Allow from all </span><span style="color: #0000ff;"></span><span style="color: #800000;">Directory</span><span style="color: #0000ff;">></span> <span style="color: #0000ff;"><span style="color: #800000;">IfModule </span><span style="color: #ff0000;">dir_module</span><span style="color: #0000ff;">></span><span style="color: #000000;"> DirectoryIndex index.php index.html index.htm default.php default.htm default.html </span><span style="color: #0000ff;"></span><span style="color: #800000;">IfModule</span><span style="color: #0000ff;">></span> <span style="color: #0000ff;"></span><span style="color: #800000;">VirtualHost</span><span style="color: #0000ff;">></span></span></span></span></span></span></span>
DocumentRoot represents the directory where the website project is located, ServerName represents the second-level domain name, and ServerAlias is the alias (a complete second-level domain name (with www.) or a subdomain name is allowed),
In the ThinkPHP project, different module entries can be easily distinguished by configuring different entry files index.php and mobile.php. Combined with the .htaccess file, the routing URL can be simplified.
If the httpd-vhost.conf file configuration does not work, there are two points to note:
1. The http-vhosts.conf module is allowed to be loaded in the Apache configuration file httpd.conf:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
2. Enable rewrite-module function;
In the test environment, you can configure the system host file and add
192.168.1.122 testimmi.com
192.168.1.122 m.testimmi.com
192.168.1.122 www.testimmi.com
Let’s simulate the situation of applying for a second-level domain name

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Chinese version
Chinese version, very easy to use

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)
