Two sites on one http port. apache rewrite
<VirtualHost *:80>
DocumentRoot "/var/www/html/mysite1/"
ServerName mysite1.com
ServerAlias *.mysite1.com
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite1.com$ [NC]
RewriteRule ^(.+)$ http://www.mysite1.com/$1 [R=301,L]
ErrorLog /var/log/httpd/mysite1_error_log
TransferLog /var/log/httpd/mysite1_access_log
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/html/mysite2/"
ServerName mysite2.com
ServerAlias *.mysite2.com
ErrorLog /var/log/httpd/mysite2_error_log
TransferLog /var/log/httpd/mysite2_access_log
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/html/mysite1/"
ServerName mysite1.com
ServerAlias *.mysite1.com
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite1.com$ [NC]
RewriteRule ^(.+)$ http://www.mysite1.com/$1 [R=301,L]
ErrorLog /var/log/httpd/mysite1_error_log
TransferLog /var/log/httpd/mysite1_access_log
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/html/mysite2/"
ServerName mysite2.com
ServerAlias *.mysite2.com
ErrorLog /var/log/httpd/mysite2_error_log
TransferLog /var/log/httpd/mysite2_access_log
</VirtualHost>
Комментариев нет:
Отправить комментарий