访问域名redmine.xx.com 跳转到redmine.xx.net
<VirtualHost *:80>
ServerName redmine.xx.com
# ServerAlias redmine.xx.com
DocumentRoot /var/www/app/redmine/public/
ErrorLog logs/redmine_error_log
<Directory /var/www/app/redmine/public/>
Options -MultiViews
Options ALL
Order allow,deny
Allow from all
AllowOverride All
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine on
# RewriteCond %{HTTP_HOST} ^redmine.xx.com [NC]
RewriteRule ^(.*) http://redmine.xx.net$1 [R=301,L]
</IfModule>
</VirtualHost>
<VirtualHost *:80>
ServerName redmine.xx.net
DocumentRoot /var/www/app/redmine/public/
</VirtualHost>
本文详细介绍了如何在Apache服务器中配置域名redmine.xx.com跳转至redmine.xx.net的过程,通过修改VirtualHost设置和使用rewrite模块实现301永久重定向。

838

被折叠的 条评论
为什么被折叠?



