当我使用站点地图生成工具并将网站设置为xyz.com而不是爬行xyz.com的URL时,我已经创建了一个子域tutorial.xyz.com。 apache如下。我想要的是分别对域和子域进行爬网。
<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName xyz.com
ServerAlias www.xyz.com
DocumentRoot /var/www/html
ServerName tutorial.xyz.com
ServerAlias www.tutorial.xyz.com
DocumentRoot /var/www/html/tutorial
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName job.xyz.com
ServerAlias www.job.xyz.com
DocumentRoot /var/www/html/job
</VirtualHost>
other file settings
<VirtualHost _default_:80>
ServerName xyz.com:443
ServerAlias www.xyz.com
ServerSignature Off
RewriteEngine On
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
ErrorLog /var/log/apache2/redirect.error.log
LogLevel warn
</VirtualHost>